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

How many methods in the Externalizable interface?
How many methods in the Externalizable interface? There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal().
2012-05-29, 2858👍, 0💬

What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?
What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class? Strategically speaking, threads created by implementing Runnable interface are more advisable. If you create a thread by extending a thread class, you cannot extend any other class. If you c...
2012-05-17, 2853👍, 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, 2846👍, 0💬

What are the high-level thread states?
What are the high-level thread states? The high-level thread states are ready, running, waiting, and dead.
2012-06-15, 2842👍, 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, 2841👍, 0💬

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, 2839👍, 0💬

What are wrapped classes?
What are wrapped classes? Wrapped classes are classes that allow primitive types to be accessed as objects.
2012-06-25, 2834👍, 0💬

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, 2833👍, 0💬

What are the different scopes for Java variables?
What are the different scopes for Java variables? The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point in time. 1. Instance : - These are typical object level variables, they are initiali...
2013-06-28, 2812👍, 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, 2811👍, 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, 2808👍, 0💬

Why do we need to use getSystemResource() and getSystemResources() method to load resources?
Why do we need to use getSystemResource() and getSystemResources() method to load resources? Because we want to look for resources strictly from the system classpath, These methods use the system ClassLoader to locate resources, which gives you stricter control of the resources used by the applicati...
2012-09-12, 2804👍, 0💬

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

Does a class inherit the constructors of its superclass?
Does a class inherit the constructors of its superclass? A class does not inherit constructors from any of its superclasses.
2012-07-20, 2793👍, 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, 2790👍, 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, 2790👍, 0💬

What can go wrong if you replace &emp;&emp; with &emp; in the following code: String a=null; if (a!=null && a.length()&gt;10) {
What can go wrong if you replace &emp;&emp; with &emp; in the following code: String a=null; if (a!=null && a.length()&gt;10) {...} A single ampersand here would lead to a NullPointerException.
2012-06-19, 2789👍, 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, 2782👍, 0💬

Why do threads block on I/O?
Why do threads block on I/O? Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed.
2012-09-14, 2779👍, 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, 2770👍, 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, 2764👍, 0💬

What are synchronized methods and synchronized statements?
What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to a method or an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to s...
2012-06-04, 2763👍, 0💬

What are the different identifier states of a Thread?
What are the different identifier states of a Thread? The different identifiers of a Thread are: R - Running or runnable thread S - Suspended thread CW - Thread waiting on a condition variable MW - Thread waiting on a monitor lock MS - Thread suspended waiting on a monitor lock
2013-02-07, 2761👍, 0💬

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