Interview Questions - Java Basics
85.
Is delete a keyword in Java?
No. delete is not a keyword in Java. Java does not make use of explicit destructors the way C++ does.
86.
Is exit a keyword in Java?
No. To exit a program explicitly you use exit method in System object.
87.
What happens if you dont initialize an instance variable of any of the primitive types in Java?
Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0(zero), a boolean will be initialized to false.
88.
What will be the initial value of an object reference which is defined as an instance variable?
The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else you will get NullPointerExceptions everywhere you try to use such default initialized references.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers