Interview Questions

Q:

What are the 3main tasks of JVM?

Answer

The JVM performs three main tasks:


• Loads code


• Verifies code


• Executes code

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 1533
Q:

An algorithm written once which can be used in many places is called

A) Block B) Function
C) Datatype D) None
 
Answer & Explanation Answer: B) Function

Explanation:

Function is an algorithm which can be used any where in the program when required

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2349
Q:

Client code having direct access to internal data is called

A) Encapsulation B) DataHiding
C) Polymorphism D) DataAbstraction
 
Answer & Explanation Answer: B) DataHiding

Explanation:

Client code must use setters and getters to access internal data in DataHiding

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 1864
Q:

There is one default constructor in every class.

A) The above statement is true B) The above statement is false
C) Both true and false D) None
 
Answer & Explanation Answer: A) The above statement is true

Explanation:

There will always be a default constructor in every class 

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 3146
Q:

Which of the following is not the other name of attriibute?

A) Data member B) Instance variable
C) instance D) Data filed
 
Answer & Explanation Answer: C) instance

Explanation:

Instance is an object not an attribute

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2054
Q:

In a single virtual machine, the Java programming language passes arguments by

A) Refference B) Value
C) Both A and B D) None
 
Answer & Explanation Answer: B) Value

Explanation:

In single virtual machine,JVM passes arguments only by value.

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2070
Q:

Which key word is to be used to tell the JVM to skip the variable while performing the serialization process of the object containing it?

A) Transcient B) Volatile
C) Static D) Final
 
Answer & Explanation Answer: A) Transcient

Explanation:

If you mark an instance variable as transient, you're telling the JVM to skip (ignore) this variable when you attempt to serialize the object containing it.

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 2271
Q:

Which method names follow the JavaBeans standard?

A) addSize B) putDimensions
C) getCust D) deleteRep
 
Answer & Explanation Answer: C) getCust

Explanation:

C use the valid prefixes 'get' and 'is

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 7509