Java Interview Questions and Answers for Experienced Pdf - 1

Question: 1

What is a Java Virtual Machine?

A Java Virtual Machine is a runtime environment required for execution of a Java application.

Each Java application runs inside a runtime instance of some concrete implementation of abstract specifications of JVM.

It is JVM which is crux of platform independent nature of the language.

Question: 2

Why java does not support pointers?

Because pointers are unsafe, Java uses reference types to hide pointer and programmers feel easier to deal with reference types without pointers.

Question: 3

What is encapsulation?

Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse.

Question: 4

What is polymorphism?

Polymorphism is the feature that allows one interface to be used for general class actions.

Polymorphism is the feature of OOPs. One interfaces multiple implementations.

Designing a generic interface for a group of related activities.

This helps reduce. Complexity by allowing the same interface to be used to specify a general class of action.

Polymorphism is achieved in a class by method overloading.

Run time Polymorphism is achieved in a class hierarchy by method overriding.

Question: 5

What is the purpose of the runtime class?

The purpose of the Runtime class is to provide access to the Java runtime system.

Related Questions