-
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. Thisincludes the Error and Exception types.
-
What is the relationship between an event-listener interface and anevent-adapter class
An event-listener interface defines the methods that must be implemented by an eventhandler for a particular kind of event. An event adapter provides a default implementationof an event-listener interface.
-
What restrictions are placed on the values of each case of a switch statement
During compilation, the values of each case of a switch statement must evaluate to avalue that can be promoted to an int value.
-
How are the elements of a GridBagLayout organized
The elements of a GridBagLayout are organized according to a grid. However, theelements are of different sizes and may occupy more than one row or column of the grid.In addition, the rows and columns may have different sizes.
-
What advantage do Java's layout managers provide over traditional windowingsystems
Java uses layout managers to lay out components in a consistent manner across allwindowing platforms. Since Java's layout managers aren't tied to absolute sizing andpositioning, they are able to accomodate platform-specific differences among windowingsystems.
-
When is the finally clause of a try-catch-finally statement executed
The finally clause of the try-catch-finally statement is always executed unless the threadof execution terminates or an exception occurs within the execution of the finally clause.
-
What is the relationship between a method's throws clause and the exceptionsthat can be thrown during the method's execution
A method's throws clause must declare any checked exceptions that are not caught withinthe body of the method.
-
What is the difference between the JDK 1.02 event model and the event-delegationmodel introduced with JDK 1.1
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model,components are required to handle their own events. If they do not handle a particularevent, the event is inherited by (or bubbled up to) the component's container. Thecontainer then either handles the event or it is bubbled up to its container and so on, untilthe highest-level container has been tried..In the event-delegation...
-
What is your platform's default character encoding
If you are running Java on English Windows platforms, it is probably Cp1252. If you arerunning Java on English Solaris platforms, it is most likely 8859_1..
-
What restrictions are placed on method overriding
Overridden methods must have the same name, argument list, and return type.The overriding method may not limit the access of the method it overrides.The overriding method may not throw any exceptions that may not be thrownby the overridden method.
-
What is numeric promotion
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type,so that integer and floating-point operations may take place. In numerical promotion,byte, char, and short values are converted to int values. The int values are also convertedto long values, if necessary. The long and float values are converted to double values, asrequired.
-
What is a Java package and how is it used
A Java package is a naming context for classes and interfaces. A package is used tocreate a separate name space for groups of classes and interfaces. Packages are also usedto organize related classes and interfaces into a single API unit and to controlaccessibility to these classes and interfaces.
-
What are synchronized methods and synchronized statements
Synchronized methods are methods that are used to control access to an object. A threadonly executes a synchronized method after it has acquired the lock for the method'sobject or class. Synchronized statements are similar to synchronized methods. Asynchronized statement can only be executed after a thread has acquired the lock for theobject or class referenced in the synchronized statement.
-
What are the two basic ways in which classes that can be run as threads may bedefined
A thread class may be declared as a subclass of Thread, or it may implement theRunnable interface.
-
What are the problems faced by Java programmers who don't use layout managers
Without layout managers, Java programmers are faced with determining how their GUIwill be displayed across multiple windowing systems and finding a common sizing andpositioning that will work within the constraints imposed by each windowing system.
-
-
-
-
-
Java Interview Questions
Ans