R4R
Right Place For Right Person TM
 
R4R Java Core JavaCorejava Interview Question And Answer Corejava Interview Question And Answer

 


Tolal:10 Click: 1
Previous Home Next

COREJAVA Interview Questions And Answers

Page 1

Ques: 1 What is the difference between a Choice and a List?

Ans:
A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

Ques: 2 What is the relationship between an event-listener interface and an event-adapter class?

Ans:
An event-listener interface defines the methods that must be implemented by an event handler for a particular kind of event. An event adapter provides a default implementation of an event-listener interface.

Ques: 3 How many bits are used to represent Unicode, ASCII, UTF-16 and UTF-8 characters?

Ans:
Unicode requires 16-bits and ASCII requires 8-bits. Although the ASCII character set uses only 1-bits, it is usually represented as 8-bits. UTF-8 represents characters using 8, 16 and 18-bit patterns. UTF-16 uses 16-bit and larger bit patterns

Ques: 4 What is the difference between the File and RandomAccessFile classes?

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

Ques: 5 What is the purpose of the File class?

Ans:
The File class is used to create objects that provide access to the files and directories of a local file system.

Ques: 6 What is the output of the following program?
public class AA {
public static void main(String args[]) {
String s1 = "abc";
String s2 = "def";
String s3 = s1.concat(s2.toUpperCase( ) );
System.out.println(s1+s2+s3);
}
}

Ans:
abcdefabcDEF

Ques: 7 What is the difference between String and StringBuffer?

Ans:
String objects are constants, whereas StringBuffer objects are not. String class supports constant strings, whereas StringBuffer class supports growable, modifiable strings.

Ques: 8 What is the ‘finally’ block?

Ans:
Finally block will execute whether or not an exception is thrown. If an exception is thrown, the finally block will execute even if no catch statement match the exception. Any time a method is about to return to the caller from inside try/catch block, via an uncaught exception or an explicit return statement, the finally clause is also execute.

Ques: 9 What is the difference between prefix and postfix of -- and    operators?

Ans:
The prefix form returns the increment or decrement operation and returns the value of the increment or decrement operation.The postfix form returns the current value of all of the expression and thenperforms the increment or decrement operation on that value.

Ques: 10 What are the three OOPs principles and define them?

Ans:
Encapsulation, Inheritance and Polymorphism are the three OOPs Principles. Encapsulation: Is the Mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. Inheritance: Is the process by which one object acquires the properties of another object. Polymorphism: Is a feature that allows one interface to be used for a general class of actions.


Goto Page:

1
Share |

COREJAVA Objective

COREJAVA Objective Questions And Answers

COREJAVA Interview Questions And Answers

COREJAVA Subjective Questions And Answers

R4R,COREJAVA Objective, COREJAVA Subjective, COREJAVA Interview Questions And Answers,COREJAVA,COREJAVA Interview,COREJAVA Questions ,COREJAVA Answers

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R