-
-
-
-
-
-
-
What does the "final" keyword mean in front of a variable? A method? A class?
FINAL for a variable : value is constantFINAL for a method : cannot be overriddenFINAL for a class : cannot be derived
-
Can an object be garbage collected while it is still reachable
A reachable object cannot be garbage collected. Only unreachable objects may begarbage collected..
-
Is &&= a valid Java operator
No, it is not.
-
-
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8characters
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set usesonly 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16,and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.
-
What is a task's priority and how is it used in scheduling
A task's priority is an integer value that identifies the relative order in which it should beexecuted with respect to other tasks. The scheduler attempts to schedule higher prioritytasks before lower priority tasks.
-
In which package are most of the AWT events that support the event-delegationmodel defined
Most of the AWT-related events of the event-delegation model are defined in thejava.awt.event package. The AWTEvent class is defined in the java.awt package.
-
What is the advantage of the event-delegation model over the earlier eventinheritancemodel
The event-delegation model has two advantages over the event-inheritance model. First,it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component's designand its use. The other advantage of the event-delegation model is that it performs muchbetter in applications where many events are generated....
-
How are Java source code files named
A Java source code file takes the name of a public class or interface that is defined withinthe file. A source code file may contain at most one public class or interface. If a publicclass or interface is defined within a source code file, then the source code file must takethe name of the public class or interface. If no public class or interface is defined within asource code file, then the file...
-
What is the relationship between the Canvas class and the Graphics class
A Canvas object provides access to a Graphics object via its paint() method.
-
What is an object's lock and which object's have locks
An object's lock is a mechanism that is used by multiple threads to obtain synchronizedaccess to the object. A thread may execute a synchronized method of an object only afterit has acquired the object's lock. All objects and classes have locks. A class's lock isacquired on the class's Class object.
-
How are the elements of a BorderLayout organized
The elements of a BorderLayout are organized at the borders (North, South, East, andWest) and the center of a container.
-
When can an object reference be cast to an interface reference
An object reference be cast to an interface reference when the object implements thereferenced interface.
-
How is rounding performed under integer division
The fractional part of the result is truncated. This is known as rounding toward zero.
Java Interview Questions
Ans