Core Java Interview Questions – Set 09

How are commas used in the intialization and iteration parts of a for statement

Commas are used to separate multiple statements within the initialization and iteration parts of a forstatement.

When are the non static variables loaded into the memory

They are loaded just before the constructor is called

What modifiers can be used with a local inner class

A local inner class may be final or abstract.

What is the difference between a public and a non-public class

A public class may be accessed outside of its package.

A non-public class may not be accessed outside of its package.

What value does read() return when it has reached the end of a file

The read() method returns -1 when it has reached the end of a file.

What is the purpose of the System class

The purpose of the System class is to provide access to system resources.

What is Inet address

?– Every computer connected to a network has an IP address. An IP address is a number that uniquely identifies each computer on the Net. An IP address is a 32-bit number.

What modifiers may be used with an inner class that is a member of an outer class?

A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

What are wrapped classes

Wrapped classes are classes that allow primitive types to be accessed as objects.

Which non-Unicode letter characters may be used as the first character of an identifier?

The non-Unicode letter characters $ and _ may appear as the first character of an identifier