What is meant by getCodeBase and getDocumentBase method?

What is meant by getCodeBase() and getDocumentBase() method?

- The getCodebase() method is also commonly used to establish a path to other files or folders that are in the same location as the class being run.

- The getDocumentBase() method is used to return the URL of the directory in which the document is resides.

URL getCodeBase(): Gets the base URL.

URL getDocumentBase(): Gets the URL of the document in which the applet is embedded.
30 Core Java Interview Questions and Answers for Freshers
Core java interview questions and answers for freshers - What are the basic features of java?, How java becomes object oriented?, How java becomes robust?, How a Java program compiles?
40 Core Java Interview Questions and Answers for Experienced
Core Java Interview Q & A for experienced - Why we prefer event-delegation model over earlier event-inheritance model?, How is Java source code files named?, What are the advantages of Java layout managers?
Define class and object. Explain them with an example using java
Class and object - Class: A class is a program construct which encapsulates data and operations on data. In object oriented programming, the class can be viewed as a blue print of an object...
Post your comment