Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Test your skills through the online practice test: Core Java Quiz Online Practice Test

Ques 6. Java says "write once, run anywhere". What are some ways this isn't quite true?

As long as all implementaions of java are certified by sun as 100% pure java this promise of "Write once, Run everywhere" will hold true. But as soon as various java core implemenations start digressing from each other, this won't be true anymore. A recent example of a questionable business tactic is the surreptitious behavior and interface modification of some of Java's core classes in their own implementation of Java. Programmers who do not recognize these undocumented changes can build their applications expecting them to run anywhere that Java can be found, only to discover that their code works only on Microsoft's own Virtual Machine, which is only available on Microsoft's own operating systems.

Is it helpful? Add Comment View Comments
 

Ques 7. What is phantom memory?

Phantom memory is false memory. Memory that does not exist in reality.

Phantom references are most often used for scheduling pre-mortem cleanup actions in a more flexible way than is possible with the java finalization mechanism. Unlike soft and weak references, phantom references are not automatically cleared by the garbage collector as they are enqueued.

Is it helpful? Add Comment View Comments
 

Ques 8. What is the return type of a program's main() method?

A program's main() method has a void return type.

public static void main(String args[])
{
	System.out.println("WithoutBook");
}

Is it helpful? Add Comment View Comments
 

Ques 9. What gives java it's "write once and run anywhere" nature?

Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to a particular operating system, the code platform specific machine code is generated thus making java platform independent.

Is it helpful? Add Comment View Comments
 

Ques 10. What is java.lang package in Core java?

For writing any java program, the most commonly required classes & interfaces are defined in a separate package called java.lang package. This package is by default available for every java program, no import statement is required to include this package.
Few Examples:
java.lang.Object
java.lang.Class
java.lang.String

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook