Category: Core Java

What is the ResourceBundle class? 0

What is the ResourceBundle class?

The java.util.ResourceBundle class is used to store texts and components that are locale sensitive. ResourceBundle has the subclasses PropertiesResourceBundle and ListResourceBundle. public abstract class ResourceBundle extends Object Resource bundles contain locale-specific objects. When your...

What are the Object and Class classes used for? 0

What are the Object and Class classes used for?

Object class Object is a Superclass for all class The Object class, in the java.lang package, sits at the top of the class hierarchy tree. Every class is a descendant, direct or indirect, of...

Is JVM platform independent? 0

Is JVM platform independent?

The JVM must be platform dependent to allow your Java to run on the specific platform. A JVM for Windows will translate your Java into different system calls than a JVM for OS X....

What are the disadvantages of using threads? 0

What are the disadvantages of using threads?

Because threads have some of the properties of processes, they are sometimes called lightweight processes. In a process, threads allow multiple executions of streams. This is why thread needs its own stack. An operating...

What interface must an object implement before it can be written to a stream as an object? 0

What interface must an object implement before it can be written to a stream as an object?

We need to implement java.io.Serializable interface which we are willing to write to a stream as an object. Example import java.io.Serializable; public class Employee implements Serializable { Integer empId; String empName; public Integer getEmpId()...

why do you create interfaces, and when MUST you use one? 0

why do you create interfaces, and when MUST you use one?

As many people have probably already given their Idea, interfaces can be used to enforce certain behaviors between classes that will not implement those behaviors the same way. So by implementing an interface you...

What is Flushing in java? 0

What is Flushing in java?

The java.io.Writer.flush method flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another...

How many methods do u implement if implement the Serializable Interface? 0

How many methods do u implement if implement the Serializable Interface?

No any method is required to implement. Here is the declaration of Serializable Interface. public abstract interface java.io.Serializable { }

What is the diff between the Reader/Writer class hierarchy and the InputStream/OutputStream Class? 0

What is the diff between the Reader/Writer class hierarchy and the InputStream/OutputStream Class?

The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented. Most of the functionality available for byte streams is also provided for character streams. The methods for character streams generally accept...