Top 25 Core Java Interview Questions For Freshers - InstanceOfJava
Top 25 Core Java Interview Questions For Freshers - InstanceOfJava
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
Home
Phone Interview
Java SE
Java EE
Concept-Program
Interview Questions
Concept-Qsns
Programs
Sorting
Java Quiz
Bigdata
Home Core java Interview Questions Top 25 Core java interview questions for freshers
Top25Corejavainterviewquestionsforfreshers
Posted by: InstanceOfJava
comment : 1
1.whatisatransientvariable?
A transient variable is a variable that whose value is not going to be serialized
2.Whatissynchronization?
With respect to multithreading, synchronization is the capability to control the access of multiple threads to
shared resources.
Without synchronization, it is possible for one thread to modify a shared object while another thread is in the
process of using or updating that objects value. This often leads to significant errors.
3.Whatsnewwiththestop(),suspend()andresume()methodsinJDK1.2?
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.
4.Isnullakeyword?
"null" is not a keyword. .null is a literal.
5.Whatstatedoesathreadenterwhenitterminatesitsprocessing?
When a thread terminates its processing, it enters the dead state.
6.WhatistheCollectionsAPI?
The Collections API is a set of classes and interfaces that support operations on collections of objects.
7.WhatistheListinterface?
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
1/6
10/26/2016
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
The List interface provides support for ordered collections of objects which allows duplicate elements also.
8.WhatistheVectorclass?
The Vector class provides the capability to implement a growable array of objects
9.CanweinstantiateAbstractclass?
We can not create object for abstract class directly. but indirectly through sub class object we can achieve it.
10.Whatisthefirstkeywordusedinajavaprogram?
Its "package" keyword.
11.Whenaclassshouldbedefinedasfinal?
If we do not want allow subclasses.
If we do not want to extend the functionality.
12.Canwedeclareabstractmethodasstatic?
No, we are not allowed to declare abstract method as static.
It leads to compilation error: illegal combination of modifiers abstract and static.
13.Canweapplyabstractkeywordtointerface?
Yes, it is optional.
abstract interface A{}
14.Canwewriteemptyinterface?
Yes it is possible it is marker interface.
interface A{}
15.Canwedeclareinterfaceasfinal?
No, it leads to compile time error. Because it should allow sub class.
16.HowtosolveClassCastException?
To solve ClassCastException we should use instanceof operator.
obj instanceof class_name
17.Isxyzaprimitivevalue?
No, it is not primitive it is string literal.
18.Whenisanobjectsubjecttogarbagecollection?
An object is subject to garbage collection when it becomes unreachable to the program in which it is used.
19.Whatmethodmustbeimplementedbyallthreads?
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
2/6
10/26/2016
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
The run() method, whether they are a subclass of Thread or implement the Runnable interface.
20.Whathappensifanexceptionisnotcaught?
An uncaught exception results in the uncaughtException() method of the threads ThreadGroup being invoked,
which eventually results in the termination of the program in which it is thrown.
21.Howarethis()andsuper()usedwithconstructors?
this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.
22.Underwhatconditionsisanobjectsfinalize()methodinvokedbythegarbage
collector?
The garbage collector invokes an objects finalize() method when it detects that the object has become
unreachable.
23.Whatrestrictionsareplacedonmethodoverloading?
Methods should have same name and defer in parameters.
24.Whendoesthecompilersupplyadefaultconstructorforaclass?
The compiler supplies a default constructor for a class if no other constructors are provided.
25.Whatmodifierscanbeusedwithalocalinnerclass?
A local inner class may be final or abstract.
For More Questions Check below on your interest:
1. Concept and Interview Program
2. Concept and Interview Questions
3. 0-3 Years Core Java Interview Questions
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
3/6
10/26/2016
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
Share!
Tagged with:
10
InstanceOfJava
We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please us
search box provided right side. Search there for answers thank you.
Next
RelatedPosts
How to call non static method from static
method java
24 Sep 2016
24 Sep 2016
27 Aug 2016
26 Aug 2016
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
4/6
10/26/2016
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
man4j
Enteryourcomment...
Commentas:
Publish
RajuSai(Google)
Signout
Notifyme
Preview
Newer Post
FollowbyEmail
Home
Pages
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
Labels
5/6
10/26/2016
Emailaddress...
Top25CorejavainterviewquestionsforfreshersInstanceOfJava
Submit
Home
Collections
Servlet Tutorial
Java 8
Jsp Tutorial
Java EE
Java Programs
Java SE
Jsp
Oracle
Register With Us
Servlets Tutorial
Design Pattern
http://www.instanceofjava.com/2014/12/corejavainterviewquestions.html
6/6