Java interview questions and answers Set 1

1.What Is Java ?
Java is a programming language and computing platform released by Sun Microsystems.

2. What are features of java?
Simple,robust,secure,portable,object-oriented,multithreaded,architectural neutral etc

3.What is Encapsulation?
Encapsulation is mechanism of binding data and code together to keep it secure from outside code.

4.What is Inheritance?
Inheritance is mechanism in which one class inherits the properties of other class.for example When sub class B extends super class A class b can access the methods of superclass.

5.Type Conversion and Casting?
In java type conversion take place automaticall if large size data type store low size data type for example bye to int ,but you cannot convert int to byte.for this you have to use type casting.example int a=(int)(char variable);

6.What is array?
Array is group of similar type variable. Declaration: int a[]=new int[size];

7.What is class ?
class is blue print from which object is created.

8.What is an object in java?
Object is nothing but instance of the class which possess all the properties of the class.

9.What is constructor in java?
Constructor is block of code which executed every time the object is created.Every class contain constructor if it is not declared default constructor is invoked.

10.Garbage collector?
Whenever object is created memory is allocated to it but after deleting the object memory allocated is not released.garbage collector deallocates the memory automatically.

java interview questions and answers Set2 ->

Ask Your Queries In Comment Box

Facing difficulties in understanding the program ?

Ask Your Queries in Comment Box

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *