top 10 java interview questions and answers 2014

13
TOP 10 JAVA INTERVIEW QUESTIONS & ANSWERS 2014 SOURCE -> hirist.com

Upload: hiristcom

Post on 27-Aug-2014

929 views

Category:

Software


15 download

DESCRIPTION

What are the top 10 Java Interview Questions and Answers in 2014? Based on the most popular java questions asked in interview, we've compiled a list of the 10 most popular java interview questions in 2014. Appearing for a java interview is not easy but if you brush up enough fundamentals, then you can easily crack the interview. The above questions are the most popular java interview questions asked by major companies so make sure to download this pdf. This list includes java interview questions in the below categories: top 10 java interview questions top 10 java interview questions and answers 10 most popular interview questions core java interview questions and answers basic java interview questions and answers serialization in java interview questions core java interview questions pdf multithreading in java interview questions advanced java interview questions and answers top 10 java interview questions and answers for freshers top 100 java interview questions and answers java interview questions and answers pdf java interview questions and answers for freshers java interview questions and answers for experienced java interview questions and answers for 3 years experience java interview questions and answers pdf download java collections interview questions and answers

TRANSCRIPT

Page 1: Top 10 Java Interview Questions and Answers 2014

TOP 10JAVA INTERVIEW

QUESTIONS &

ANSWERS 2014

SOURCE -> hirist.com

Page 2: Top 10 Java Interview Questions and Answers 2014

What is JVM?

Why is Java

called the

‘Platform

Independent

Programming

Language’?

#1Java Virtual Machine, is an interpreter which accepts „Bytecode‟ and executes it.

It primarily works on the notion of „compile once, run everywhere‟.

The translation into Bytecode makes a program easier to be executed across a wide range of platforms

JVMs for various platforms might vary in configuration but they all understand the same set of Bytecode

SOURCE -> hirist.com

Page 3: Top 10 Java Interview Questions and Answers 2014

Which two

methods do

you need to

implement for

key Objects in

HashMap ?

#2

It must implement equals and hashcode method in Java

Equals and hashcode method is used to put and get object from HashMap

SOURCE -> hirist.com

Page 4: Top 10 Java Interview Questions and Answers 2014

What is

the

Difference

between

JDK and

JRE?

#3The “JDK” is the Java Development Kit. i.e., the JDK is bundle of software that you can use to develop Java based software

The “JRE” is the Java Runtime Environment. I.e., the JRE is an implementation of the Java Virtual Machine which actually executes Java programs.

Each JDK contains one (or more) JRE‟s along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.

SOURCE -> hirist.com

Page 5: Top 10 Java Interview Questions and Answers 2014

What is

immutable

object? Can

you write

immutable

object?

#4Immutable classes are Java classes whose objects can not be modified once created

Any modification in Immutable object result in a new object

For example, is String is immutable in Java

SOURCE -> hirist.com

Page 6: Top 10 Java Interview Questions and Answers 2014

What are

the Data

Types

supported

by Java?

#5There are eight Primitive Data types supported by Java

• Byte : 8-bit signed two‟s complement

integer

• Short : 16-bit signed two‟s complement

integer.

• Int : 32-bit signed two‟s complement

integer.

• Long : 64-bit signed two‟s complement

integer.

• Float, Double, Autoboxing, Unboxing

SOURCE -> hirist.com

Page 7: Top 10 Java Interview Questions and Answers 2014

www.hirist.com

Handpicked Java Jobs

Page 8: Top 10 Java Interview Questions and Answers 2014

What is

Autobox

ing and

Unboxin

g?

#6Autoboxing: The Java compiler brings about an automatic transformation of primitive type (int, float, double etc.) into their object equivalents or wrapper type (Integer, Float, Double,etc) for the ease of compilation.

Unboxing: The automatic transformation of wrapper types into their primitive equivalent is known as Unboxing.

SOURCE -> hirist.com

Page 9: Top 10 Java Interview Questions and Answers 2014

What is

Function

Over-Riding

and Over-

Loading in

Java?

#7Over-Riding: An override is a type of function which occurs in a class which inherits from another class. An override function “replaces” a function inherited from the base class, but does so in such a way that it is called even when an instance of its class is pretending to be a different type through polymorphism.

Over-Loading: Overloading is the action of

defining multiple methods with the same name,

but with different parameters. It is unrelated to

either overriding or polymorphism. Functions in

Java could be overloaded by two mechanisms

ideally:

• Varying the number of arguments.

• Varying the Data Type.

SOURCE -> hirist.com

Page 10: Top 10 Java Interview Questions and Answers 2014

What is the

difference

between Ar

ray List

and Linked

List ?

#8Array List

- Random access- Only objects can be added

Linked List

- Sequential access- Implemented using nodes linked to each other

SOURCE -> hirist.com

Page 11: Top 10 Java Interview Questions and Answers 2014

What is

difference

between

CyclicBarrier

and

CountDownLa

tch in Java

#9Main difference between both of them is that you can reuse CyclicBarrier even if Barrier is broken but you cannot reuse CountDownLatch in Java.

SOURCE -> hirist.com

Page 12: Top 10 Java Interview Questions and Answers 2014

What is

the use of

the

‘SimpleDa

teFormat’

#10SimpleDateFormat is one such concrete class which is widely used by Java developers for parsing and formatting of dates. This is also used to convert Dates to String and vice-versa..

Almost every Enterprise level Java Application invariably uses the SimpleDateFormat for handling user dates

SOURCE -> hirist.com

Page 13: Top 10 Java Interview Questions and Answers 2014

Hirist.com

Handpicked Java Jobs