KyaPoocha.com

Huge Collection of Interview Questions


Archive for May, 2007

What is the SimpleTimeZone class? 

The SimpleTimeZone class provides support for a Gregorian calendar.  Read more »

If a class is declared without any access modifiers, where may the class be accessed? 

A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces... Read more »

What classes of exceptions may be caught by a catch clause? 

A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.  Read more »

What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy? 

The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.  Read more »

What happens when a thread cannot acquire a lock on an object? 

If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object’s lock, it enters the waiting state until... Read more »

How is rounding performed under integer division? 

The fractional part of the result is truncated. This is known as rounding toward zero.  Read more »

What is the difference between the Font and FontMetrics classes? 

The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.  Read more »

Is the ternary operator written x : y ? z or x ? y : z ? 

It is written x ? y : z.  Read more »

Can an object be garbage collected while it is still reachable? 

A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected.  Read more »

Which class is extended by all other classes? 

The Object class is extended by all other classes.  Read more »

How are the elements of a BorderLayout organized? 

The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.  Read more »

What is an object’s lock and which objects have locks? 

An object’s lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of... Read more »

If a variable is declared as private, where may the variable be accessed? 

A private variable may only be accessed within the class in which it is declared.  Read more »

What is the difference between the String and StringBuffer classes? 

String objects are constants. StringBuffer objects are not.  Read more »

What is the difference between a static and a non-static inner class? 

A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object... Read more »

Page 4 of 11« First...«23456»...Last »