Home Interviewquestions Corejava Core Java Interview Question, Interview Question
Questions:Ask|Latest



Core Java Interview Question, Interview Question
Posted on: April 18, 2011 By Deepak Kumar
This page discusses - Core Java Interview Question, Interview Question

Core Java Interview Question Page 21

     

Question: How are the elements of a GridLayout organized?

Answer: The elements of a GridBad layout are of equal size and are laid out using the squares of a grid.

Question: What an I/O filter?

Answer: An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

Question: If an object is garbage collected, can it become reachable again?

Answer: Once an object is garbage collected, it ceases to exist.It can no longer become reachable again.

Question: What is the Set interface?

Answer: The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.

Question: What classes of exceptions may be thrown by a throw statement?

Answer: A throw statement may throw any expression that may be assigned to the Throwable type.

Question: What are E and PI?

Answer: E is the base of the natural logarithm and PI is mathematical value pi.

Question: Are true and false keywords?

Answer: The values true and false are not keywords.

Question: What is a void return type?

Answer: A void return type indicates that a method does not return a value.

Question: What is the purpose of the enableEvents() method?

Answer: The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.

Question: What is the difference between the File and RandomAccessFile classes?

Answer: 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.

Question: What happens when you add a double value to a String?

Answer: The result is a String object.

Question: What is your platform's default character encoding?

Answer: If you are running Java on English Windows platforms, it is probably Cp1252. If you are running Java on English Solaris platforms, it is most likely 8859_1..

Question: Which package is always imported by default?

Answer: The java.lang package is always imported by default.

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

Answer: An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object.

Question: How are this and super used?

Answer: this is used to refer to the current object instance. super is used to refer to the variables and methods of the superclass of the current object instance.

Question: What is the purpose of garbage collection?

Answer: The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources may be reclaimed and reused.


Recommend the tutorial

Ask Questions?    Discuss: Core Java Interview Question, Interview Question  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments