Advanced java technical interview question
85. How is rounding performed under integer division? The fractional part of the result is truncated. This is known as […]
85. How is rounding performed under integer division? The fractional part of the result is truncated. This is known as […]
79. When can an object reference be cast to an interface reference? An object reference be cast to an interface
73. What is the difference between the String and StringBuffer classes? String objects are constants. StringBuffer objects are not constants.
67. How are Java source code files named? A Java source code file takes the name of a public class
55. How many times may an object’s finalize() method be invoked by the garbage collector? An object’s finalize() method may
43. What class is the top of the AWT event hierarchy? The java.awt.AWTEvent class is the highest-level class in the
37. What are order of precedence and associativity, and how are they used? Order of precedence determines the order in
31. Name three Component subclasses that support painting. The Canvas, Frame, Panel, and Applet classes support painting. 32. What value
25. What are wrapped classes? Wrapped classes are classes that allow primitive types to be accessed as objects. 26. Does
19. What is an Iterator interface? The Iterator interface is used to step through the elements of a Collection. 20.
7. What’s new with the stop(), suspend() and resume() methods in JDK 1.2? The stop(), suspend() and resume() methods have
1. What is a transient variable? A transient variable is a variable that may not be serialized. 2. Which containers
79. What is the catch or declare rule for method declarations? If a checked exception may be thrown within the
55. If I write System.exit(0); at the end of the try block, will the finally block still execute? No. In
3. What are wrapper classes? Java provides specialized classes corresponding to each of the primitive data types. These are called
3. What are wrapper classes? Java provides specialized classes corresponding to each of the primitive data types. These are called
25. Are the imports checked for validity at compile time? Example: will the code containing an import such as java.lang.ABCD
19. Can an application have multiple classes having main() method? Yes it is possible. While starting the application we mention
13. What if I write static public void instead of public static void? Program compiles and runs properly. 14. What
7. What is an Iterator? Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This
1. What is the difference between a constructor and a method? A constructor is a member function of a class
127. How does Java handle integer overflows and underflows? It uses those low order bytes of the result that can
121. To what value is a variable of the String type automatically initialized? The default value of an String type
115. What is constructor chaining and how is it achieved in Java ? A child object constructor always first needs
73. What do you understand by private, protected and public? These are accessibility modifiers. Private is the most restrictive, while