More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. member variable are loaded into heap, so they are initialized with default values when an instance of a class is created. In case of local variables, they are stored in stack until they are being used.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Class loaders are hierarchical. The very first class is specially loaded with the help of static main() method declared in your class. All the subsequently loaded classes are loaded by the classes, which are already loaded and running.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The memory pool containing all the reflective data of the java virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas. The Permanent generation contains metadata required by the JVM to describe the classes and methods used in the application. The permanent generation is populated by the JVM at runtime based on classes in use by the application. In addition, Java SE library classes and methods may be stored here.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The Permanent Generation (PermGen) space has completely been removed and is kind of replaced by a new space called Metaspace. The consequences of the PermGen removal is that obviously the PermSize and MaxPermSize JVM arguments are ignored and you will never get a java.lang.OutOfMemoryError: PermGen error.
Help us improve. Please let us know the company, where you were asked this question :
Ans. substring method would build a new String object keeping a reference to the whole char array, to avoid copying it. Hence you can inadvertently keep a reference to a very big character array with just a one character string.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Java is a portable-language because without any modification we can use Java byte-code in any platform(which supports Java). So this byte-code is portable and we can use in any other major platforms.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   bytecode   jvm   compiler   portable   features of java   basic interview question
Q27. What are the platforms supported by Java Programming Language?
Ans. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX/Linux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc
Help us improve. Please let us know the company, where you were asked this question :
Ans. Java bytecode is the instruction set of the Java virtual machine. Each bytecode is composed by one, or two bytes that represent the instruction, along with zero or more bytes for passing parameters.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes and No. JVM is an extra layer that translates Byte Code into Machine Code. So Comparing to languages like C, Java provides an additional layer of translating the Source Code.
Though it looks like an overhead but this additional translation allows Java to run Apps on all platforms as JVM provides the translation to the Machine code as per the underlying Operating System.
Help us improve. Please let us know the company, where you were asked this question :
Q31. What is Byte Code ? Why Java's intermediary Code is called Byte Code ?
Ans. Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system. Its called Byte Code because each instruction is of 1-2 bytes.
Ans. PATH is the variable that holds the directories for the OS to look for executables. CLASSPATH is the variable that holds the directories for JVM to look for .class files ( Byte Code ).
Help us improve. Please let us know the company, where you were asked this question :
Ans. No, Java runs on a virtual machine called JVM and hence doesn't embed well with the underlying hardware. Though we can create a platform independent system software but that would be really slow and that's what we would never need.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   system software java   jvm   yes-no   yes no   java operating system   architecture
Q35. Which is of the following is NOT TRUE for JVM ?
a. JVM reads Byte Code and generates Machine Code. b. JVM is a virtual Machine that acts as a intermediary between Java Application and Host Operating System. c. JVM reads Source Code and generates Byte Code. d. JVM acts as a translator that translates different Machine code ( on the basis of Host Machine ) for a common Byte Code.
Ans. JVM reads Source Code and generates Byte Code.
Help us improve. Please let us know the company, where you were asked this question :
Ans. In Java JVM memory settings is done by use the arguments -Xms -Xmx. Use M or G after the numbers for indicating Megs and Gigs of bytes respectively. -Xms indicates the minimum and -Xmx the maximum.
Help us improve. Please let us know the company, where you were asked this question :