HOME         WALKINS         CORE JOBS          GOVT JOBS          TESTING JOBS          BPO JOBS amity niit hp idea nokia religare samsung max_new_york_life naukri

Saturday, March 6, 2010

Pragramming Related Java Questions

What is a class?

A class is a blueprint, or prototype, that defines the variables and the methods common to all objects of a certain kind.


What is a object?

An object is a software bundle of variables and related methods.An instance of a class depicting the state and behavior at that particular time in real world.

What is a method?
Encapsulation of a functionality which can be called to perform specific tasks.

What is encapsulation? Explain with an example.

Encapsulation is the term given to the process of hiding the implementation details of the object. Once an object is encapsulated, its implementation details are not immediately accessible any more. Instead they are packaged and are only indirectly accessible via the interface of the object


What is inheritance? Explain with an example.

Inheritance in object oriented programming means that a class of objects can inherit properties and methods from another class of objects.


What is polymorphism? Explain with an example.

In object-oriented programming, polymorphism refers to a programming language’s ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes. For example, given a base class shape, polymorphism enables the programmer to define different area methods for any number of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying the area method to it will return the correct results. Polymorphism is considered to be a requirement of any true object-oriented programming language

Is multiple inheritance allowed in Java?

No, multiple inheritance is not allowed in Java.


What is interpreter and compiler?

Java interpreter converts the high level language code into a intermediate form in Java called as bytecode, and then executes it, where as a compiler converts the high level language code to machine language making it very hardware specific

What is JVM?

The Java interpreter along with the runtime environment required to run the Java application in called as Java virtual machine(JVM)


What are the different types of modifiers?

There are access modifiers and there are other identifiers. Access modifiers are public, protected and private. Other are final and static.


What are the access modifiers in Java?

There are 3 access modifiers. Public, protected and private, and the default one if no identifier is specified is called friendly, but programmer cannot specify the friendly identifier explicitly.

No comments:

Post a Comment