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

Can you have virtual functions in Java?
Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. This is actually a pseudo trick question because the word "virtual" is not part of the naming convention in Java (as it is in C++, C-sharp and VB.NET), so this would be a foreign concept for someone who has on...
2012-05-16, 2425👍, 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, 2422👍, 0💬

What is the difference between the File and RandomAccessFile classes?
What is the difference between the File and RandomAccessFile classes? The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.
2013-01-08, 2420👍, 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, 2402👍, 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, 2398👍, 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, 2395👍, 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, 2394👍, 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, 2389👍, 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, 2387👍, 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, 2386👍, 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, 2385👍, 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, 2383👍, 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, 2380👍, 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, 2378👍, 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, 2376👍, 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, 2367👍, 0💬

What is the immediate superclass of the Dialog class?
What is the immediate superclass of the Dialog class? Window.
2012-10-05, 2353👍, 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, 2353👍, 0💬

What is the purpose of the File class?
What is the purpose of the File class? The File class is used to create objects that provide access to the files and directories of a local file system.
2012-07-27, 2352👍, 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, 2350👍, 0💬

Name two subclasses of the TextComponent class.
Name two subclasses of the TextComponent class. TextField and TextArea
2012-10-29, 2350👍, 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, 2349👍, 0💬

What value does readLine() return when it has reached the end of a file?
What value does readLine() return when it has reached the end of a file? The readLine() method returns null when it has reached the end of a file.
2012-10-05, 2346👍, 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, 2343👍, 0💬

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