-
-
-
Can an exception be rethrown
Yes, an exception can be rethrown.
-
Which Math method is used to calculate the absolute value of a number
The abs() method is used to calculate absolute values.
-
What is the purpose of the File class
The File class is used to create objects that provide access to the files and directories of alocal file system.
-
-
-
-
What modifiers may be used with an inner class that is a member of an outerclass
A (non-local) inner class may be declared as public, protected, private, static, final, orabstract.
-
What is the argument type of a program's main() method
A program's main() method takes an argument of the String[] type.
-
Can a double value be cast to a byte
Yes, a double value can be cast to a byte.
-
Can an anonymous class be declared as implementing an interface andextending a class
An anonymous class may implement an interface or extend a superclass, but may not bedeclared to doboth.
-
What invokes a thread's run() method
After a thread is started, via its start() method or that of the Thread class, the JVMinvokes the thread'srun() method when the thread is initially executed.
-
How does Java handle integer overflows and underflows
It uses those low order bytes of the result that can fit into the size of the type allowed bythe operation.
-
What's new with the stop(), suspend() and resume() methods in JDK 1.2
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.
-
Under what conditions is an object's finalize() method invoked by the garbagecollector
The garbage collector invokes an object's finalize() method when it detects that the objecthas become unreachable.
-
If an object is garbage collected, can it become reachable again
Once an object is garbage collected, it ceases to exist. It can no longer become reachableagain.
-
What is a void return type
A void return type indicates that a method does not return a value.
-
-
What event results from the clicking of a button
The ActionEvent event is generated as the result of the clicking of a button.
Java Interview Questions
Ans