<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   Sort: Date

What is the difference between a Choice and a List?
What is the difference between a Choice and a List? A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports ...
2012-12-24, 2639👍, 0💬

What restrictions are placed on the values of each case of a switch statement?
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 a value that can be promoted to an int value.
2012-12-04, 2639👍, 0💬

Which class should you use to obtain design information about an object?
Which class should you use to obtain design information about an object? The Class class is used to obtain information about an object's design.
2012-07-23, 2639👍, 0💬

How to create a thread in a program?
How to create a thread in a program? You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread.
2012-06-11, 2639👍, 0💬

Name the containers which uses Border Layout as their default layout?
Name the containers which uses Border Layout as their default layout? Containers which uses Border Layout as their default are: window, Frame and Dialog classes.
2012-05-21, 2639👍, 0💬

What would you use to compare two String variables - the operator == or the method equals()?
What would you use to compare two String variables - the operator == or the method equals()? I'd use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.
2012-06-07, 2638👍, 0💬

What invokes a thread's run() method?
What invokes a thread's run() method? After a thread is started, via its start() method of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.
2012-06-14, 2633👍, 0💬

What is a transient variable?
What is a transient variable? A transient variable is a variable that may not be serialized.
2012-09-13, 2632👍, 0💬

Can we use System.arraycopy() method to copy the same array?
Can we use System.arraycopy() method to copy the same array? Yes, you can. The source and destination arrays can be the same if you want to copy a subset of the array to another area within that array.
2012-09-04, 2632👍, 0💬

What is design by contract?
What is design by contract? The design by contract specifies the obligations of a method to any other methods that may use its services and also theirs to it. For example, the preconditions specify what the method required to be true when the method is called. Hence making sure that preconditions ar...
2012-08-15, 2628👍, 0💬

How could Java classes direct program messages to the system console, but error messages, say to a file?
How could Java classes direct program messages to the system console, but error messages, say to a file? The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This ho...
2012-05-18, 2625👍, 0💬

What is an Iterator interface?
What is an Iterator interface? The Iterator interface is used to step through the elements of a Collection.
2012-06-21, 2622👍, 0💬

What is the Map interface?
What is the Map interface? The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.
2012-07-20, 2620👍, 0💬

Name Component subclasses that support painting?
Name Component subclasses that support painting? The Canvas, Frame, Panel, and Applet classes support painting.
2012-06-26, 2619👍, 0💬

What is the Properties class?
What is the Properties class? The properties class is a subclass of Hashtable that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used.
2012-07-05, 2618👍, 0💬

What is the package?
What is the package? The package is a Java namespace or part of Java libraries. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.
2013-02-21, 2617👍, 0💬

What is the Vector class?
What is the Vector class? The Vector class provides the capability to implement a growable array of objects
2012-06-20, 2616👍, 0💬

What is a static method?
What is a static method? A static method is a method that belongs to the class rather than any object of the class and doesn't apply to an object or even require that any objects of the class have been instantiated.
2012-07-11, 2613👍, 0💬

What is the advantage of the event-delegation model over the earlier event-inheritance model?
What is the advantage of the event-delegation model over the earlier event-inheritance model? 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). ...
2012-10-30, 2612👍, 0💬

What is the difference between yielding and sleeping?
What is the difference between yielding and sleeping? When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.
2012-06-15, 2611👍, 0💬

What happens if you dont initialize an instance variable of any of the primitive types in Java?
What happens if you dont initialize an instance variable of any of the primitive types in Java? Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0, a boolean will be initialized to false.
2013-06-27, 2610👍, 0💬

What happens when a thread cannot acquire a lock on an object?
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 the lock becomes available.
2012-06-18, 2609👍, 0💬

What is a Java package and how is it used?
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 to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control ac...
2012-08-08, 2607👍, 0💬

What is a protected method?
What is a protected method? A protected method is a method that can be accessed by any method in its package and inherited by any subclass of its class.
2012-07-11, 2607👍, 0💬

<< < 4 5 6 7 8 9 10 11 12 13 14 > >>   Sort: Date