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

How can a GUI component handle its own events?
How can a GUI component handle its own events? A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.
2012-07-24, 2342👍, 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, 2341👍, 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, 2341👍, 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, 2340👍, 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, 2338👍, 0💬

What restrictions are placed on the location of a package statement within a source code file?
What restrictions are placed on the location of a package statement within a source code file? A package statement must appear as the first line in a source code file (excluding blank lines and comments).
2012-10-02, 2337👍, 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, 2337👍, 0💬

Why would you use a synchronized block vs. synchronized method?
Why would you use a synchronized block vs. synchronized method? Synchronized blocks place locks for shorter periods than synchronized methods.
2012-07-27, 2337👍, 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, 2336👍, 0💬

What is the difference between interface and abstract class?
What is the difference between interface and abstract class? interface contains methods that must be abstract; abstract class may contain concrete methods. interface contains variables that must be static and final; abstract class may contain non-final and final variables. members in an interface ar...
2012-07-10, 2335👍, 0💬

How to define an Interface?
How to define an Interface? In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface. Emaple of Interface: public interface sampleInterface { public void funct...
2012-05-24, 2333👍, 0💬

What is the Locale class?
What is the Locale class? The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.
2012-07-09, 2329👍, 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, 2328👍, 0💬

Is Java a super set of JavaScript?
Is Java a super set of JavaScript? No. They are completely different. Some syntax may be similar.
2012-08-13, 2323👍, 0💬

Can Java object be locked down for exclusive use by a given thread?
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.
2012-06-11, 2323👍, 0💬

What are the drawbacks of inheritance?
What are the drawbacks of inheritance? Since inheritance inherits everything from the super class and interface, it may make the subclass too clustering and sometimes error-prone when dynamic overriding or dynamic overloading in some situation. In addition, the inheritance may make peers hardly unde...
2012-08-29, 2321👍, 0💬

Name primitive Java types.
Name primitive Java types. The primitive types are byte, char, short, int, long, float, double, and boolean.
2012-07-23, 2319👍, 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, 2317👍, 0💬

What's the main difference between a Vector and an ArrayList?
What's the main difference between a Vector and an ArrayList? Java Vector class is internally synchronized and ArrayList is not.
2012-06-22, 2317👍, 0💬

What is an abstract method?
What is an abstract method? An abstract method is a method whose implementation is deferred to a subclass. Or, a method that has no implementation.
2012-07-10, 2315👍, 0💬

What is the difference between a Window and a Frame?
What is the difference between a Window and a Frame? Heavy weight components like Abstract Window Toolkit (AWT), depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button....
2012-07-16, 2312👍, 0💬

What state does a thread enter when it terminates its processing?
What state does a thread enter when it terminates its processing? When a thread terminates its processing, it enters the dead state.
2012-09-20, 2311👍, 0💬

What is the purpose of the Runtime class?
What is the purpose of the Runtime class? The purpose of the Runtime class is to provide access to the Java runtime system.
2012-07-07, 2310👍, 0💬

When a thread is created and started, what is its initial state?
When a thread is created and started, what is its initial state? A thread is in the ready state after it has been created and started.
2013-06-07, 2307👍, 0💬

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