Search your topic in Java2share
Home > FAQs
eXTReMe Tracker

CoreJava FAQs

Untitled Document

Q153. What restrictions are placed on method overloading?
Two methods may not have the same name and argument list but different return types.

Q154. What happens when you invoke a thread's interrupt method while it is sleeping or waiting?
When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown.

Q155. What is casting?
There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

Q156. What is the return type of a program's main() method?
A program's main() method has a void return type.