<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Date

What is the numeric promotion?
What is the numeric promotion? Numeric promotion is used with both unary and binary bitwise operators. This means that byte, char, and short values are converted to int values before a bitwise operator is applied. If a binary bitwise operator has one long operand, the other operand is converted to a...
2012-07-02, 2369👍, 0💬

What is a transient variable?
What is a transient variable? A transient variable is a variable that may not be serialized. If you don't want some field to be serialized, you can mark that field transient or static.
2012-05-30, 2367👍, 0💬

How is rounding performed under integer division?
How is rounding performed under integer division? The fractional part of the result is truncated. This is known as rounding toward zero.
2012-11-14, 2363👍, 0💬

An application needs to load a library before it starts to run, how to code??
An application needs to load a library before it starts to run, how to code?? One option is to use a static block to load a library before anything is called. For example, class Test { static { System.loadLibrary("path-to-li brary-file");} .... } When you call new Test(), the static block will be ca...
2012-05-18, 2363👍, 0💬

How does multi-threading take place on a computer with a single CPU?
How does multi-threading take place on a computer with a single CPU? The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.
2012-06-08, 2355👍, 0💬

What is the relationship between synchronized and volatile keyword?
What is the relationship between synchronized and volatile keyword? The JVM is guaranteed to treat reads and writes of data of 32 bits or less as atomic.(Some JVM might treat reads and writes of data of 64 bits or less as atomic in future) For long or double variable, programmers should take care in...
2012-08-28, 2348👍, 0💬

What is the difference between Serializalble and Externalizable interface?
What is the difference between Serializalble and Externalizable interface? When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Extern...
2012-05-29, 2348👍, 0💬

What is similarities/difference between an Abstract class and Interface?
What is similarities/difference between an Abstract class and Interface? Differences are as follows: Interfaces provide a form of multiple inheritance. A class can extend only one other class. Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a ...
2012-05-23, 2347👍, 0💬

What is the difference between throw and throws keywords?
What is the difference between throw and throws keywords? The throw keyword denotes a statement that causes an exception to be initiated. It takes the Exception object to be thrown as argument. The exception will be caught by an immediately encompassing try-catch construction or propagated further u...
2012-07-19, 2341👍, 0💬

If a class is declared without any access modifiers, where may the class be accessed?
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 or friendly access. This means that the class can only be accessed by other classes and interfaces that are defined within the same pack...
2012-07-19, 2339👍, 0💬

Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a change to the map. He decided to
Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a change to the map. He decided to make a clone of the map in order to save the original data on side. What do you think of it? ? If Jack made a clone of the map, any changes to the clone or the original map...
2012-05-16, 2339👍, 0💬

How many methods in the Serializable interface?
How many methods in the Serializable interface? There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable.
2012-05-28, 2330👍, 0💬

What is NullPointerException and how to handle it?
What is NullPointerException and how to handle it? When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: --Calling the instance method of a null object. --Accessing or modifying the field of a null object. --Taking the len...
2012-05-17, 2328👍, 0💬

If a method is declared as protected, where may the method be accessed?
If a method is declared as protected, where may the method be accessed? A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.
2012-06-21, 2319👍, 0💬

Is exit a keyword in Java?
Is exit a keyword in Java? No. To exit a program explicitly you use exit method in System object.
2013-06-27, 2318👍, 0💬

What are three ways in which a thread can enter the waiting state?
What are three ways in which a thread can enter the waiting state? A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoki...
2012-06-04, 2318👍, 0💬

Name two subclasses of the TextComponent class.
Name two subclasses of the TextComponent class. TextField and TextArea
2012-10-29, 2317👍, 0💬

Can an inner class declared inside of a method access local variables of this method?
Can an inner class declared inside of a method access local variables of this method? It's possible if these variables are final.
2012-06-19, 2317👍, 0💬

How to define an Abstract class?
How to define an Abstract class? A class containing abstract method is called Abstract class. An Abstract class can't be instantiated. Example of Abstract class: abstract class testAbstractClass { protected String myString; public String getMyString() { return myString; } public abstract string anyA...
2012-05-24, 2317👍, 0💬

How the object oriented approach helps us keep complexity of software development under control?
How the object oriented approach helps us keep complexity of software development under control? We can discuss such issue from the following aspects: Objects allow procedures to be encapsulated with their data to reduce potential interference. Inheritance allows well-tested procedures to be reused ...
2012-08-14, 2301👍, 0💬

What is the Set interface?
What is the Set interface? The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.
2012-08-02, 2294👍, 0💬

Is Iterator a Class or Interface? What is its use?
Is Iterator a Class or Interface? What is its use? Iterator is an interface which is used to step through the elements of a Collection.
2012-05-23, 2292👍, 0💬

Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?
Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written? Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.
2012-06-13, 2289👍, 0💬

What will be the default values of all the elements of an array defined as an instance variable?
What will be the default values of all the elements of an array defined as an instance variable? If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. e.g. All the elements of an array of int wil...
2013-07-03, 2288👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Date