CORE JAVA INTERVIEW QUESTIONS
1. Explain
about JVM ?
2. Explain
about JRE ?
3. What
is mean by bytecode?
4.
Explain about System.out.println(" ..........");
1.
why we want to use "System" ? and what is the
"System"?
2. what is "out" and what
it's use?
3. what is println?
5. Explain about public Static void
main(String args[]) ?
1. why we are using “Static” in main method?
2.why we are passing only (String
args[]) as parameter?
6. Explain flow of java program execution?
7. Explain about JIT compilation?
8. Explain JAVA features?
9. Why java is object oriented programming
language?
10. What are the
principles of OOPS?
11. What is an object, explain properties
of an object ?
12. What is class?
13. What is class class?
14. Explain Object class methods?
15. What is Encapsulation give me one
example?
16. What is Abstraction give me one
example?
17. What is mean by polymorphisms and types
of polymorphism explain?
18. What is the difference between dynamic
polymorphism and static polymorphism?
19. Explain Is-a & has-a relationship?
20. What is object life time?
21. What is inheritance and explain types
of inheritance?
22.
What is constructor?
23. How many types of constructors are
there and explain?
24. Can we call explicitly constructor?
25. How can we call from default constructor
parameterized constructor?
26. Does a class inherit the constructor
of its super class?
27. Can we make constructor static?
28. Can we make final keyword before
constructor?
29. What is the difference between
constructor and method?
30. What is hash code?
31.
Character default
value?
32.
Can you declare a class
as private?
33.
When is a constructor
called, before or after creating the object?
34.
What is the difference
between default constructor and
parameterized constructor?
35.
What is constructor
over loading?
36.
Can we make access specifiers before constructor?
37.
What is mean by Access specifier and types of access specifier?
38.
Leas order of Access specifier?
39.
Heighest order of Access specifier?
40.
What is mean by access modifiers and explain?
41.
What is the difference
between the instance variables and static variables?
42.
What are instance
methods?
43.
What are static
methods?
44.
Why instance variable
not available to static methods?
45.
In how many ways can
you create an object in java?
46.
What is anonymous inner
class?
47.
What are factory
methods?
48.
Is it possible to
compile and run a java program without writing main method()?
49.
How objects are passed
to methods in java?
50.
What is the use of this(),this(..) keywords?
51.
What is the use of super(),super(..) keywords?
52.
What is the difference between this() and super() keywords?
53.
Can we override private
methods?
54.
Can we take private
methods and final methods as same?
55.
What is final?
56.
How to prevent method
overriding?
57.
How to prevent
inheritance in java?
58.
What is mean by
shadowing?
59.
Can we possible to
override the static methods?
60.
What is static block
and explain?
61.
What is instance block
and explain?
62.
What is difference
between instance block and static block?
63.
Incorporating more than
one constructor in a class is called?
64.
What is specialization
and generalization?
65.
What is implicit
casting?
66.
What is explicit
casting?
67.
Can we call class as a
data type?
68.
What happens if main()
method is written without String args[ ] ?
69.
Can you call the main()
of a class from another class?
70.
What are the modifiers
in java?
71.
What is abstract
method?
72.
What is abstract class?
73.
Abstract classes can contain abstract methods?
74.
Explain about transient
modifier?
75.
Explain about native
modifier?
76.
Explain about volatile
modifier?
77.
What is mean by
synchronisation?
78.
Why would you use a
synchronized block verses synchronized method?
79.
What is interface?
80.
Can you write an
interface without any methods?
81.
What do you call the
interface without any members?
82.
How can you force your
programmer to implement only the features of your class?
83.
Can we declare a class
as abstract and final?
84.
Can we override
abstract methods?
85.
Can we implement one interface from another?
86.
Why the method of
interfaces are public and abstract by default?
87.
Can we write a class
with in an interface?
88.
What is the difference
between an interface and an abstract class?
89.
Can we create an object
to interface?
90.
When we go for abstract
and interface in java?
91.
Why we use interfaces?
92.
What is the difference
between a class and an abstract class?
93.
What is the difference
between an interface and an abstract class?
94.
What is class loader
and explain types of class loaders?
95.
Explain about system class loader?
96.
Explain Annotations in
java?
97.
Explain about memory
management in java?
98.
Is String a class or
data type?
99.
String s = “ pooji ” ;
String s1 = new String(“ pooji”);
System.out.println(s=s1);
System.out.println(s.equals(s1));
What is the output?
100.
What is object
reference?
101.
What is the difference
between == and equals() while comparing String? Which one is reliable?
102.
What is string constant
pool?
103.
Why overrides equals()
and hashcode()?
104.
What is difference
between String and StringBuffer classes?
105.
What is main different
between StringBuffer and StringBuilder classes?
106.
What is an Error?
107.
Write an exception
hierarchy?
108.
What is an Exception?
109.
What is the difference
between error and an Exception?
110.
What is mean by
Exception handling?
111.
What are the types of
Exceptions?
112.
What is throwable?
113.
What is the super class
for all Exceptions?
114.
What is the difference
between throws and throw?
115.
Is it possible to
re-throw exceptions?
116.
What is the purpose of
finally block?
117.
What is the purpose of
finalization?
118.
Explain final, finally,
finalization?
119.
If i write
system.exit(0); at the end of the try block, will the finally block will
execute?
120.
If i write return at
the end of try block, will the finally block will execute?
121.
How to create user
defined exceptions?
122.
How to override methods
in exception handling?
123.
Can a top level class
be private or protected?
124.
What is the default
value of an object reference declared as
an instance variable
125.
Is it necessary that
each try block must be fallowed by a catch block?
126.
What is fail fast
exception?
127.
How can you call the
garbage collector?
128.
What is the scope of
default access specifier?
129.
What is the difference
between return and system.exit(0)?
130.
What is difference
between System.exit(0) and system.exit(1);
131.
Write collection
hierarchy?
132.
What are limitations of object Arrays?
133.
What are differences
between arrays and collections?
134.
What is Collection API
?
135.
What is Collection framework?
136.
What is
difference between Collections and Collection?
137.
Explain about
Collection interface?
138.
Explain about List
interface?
139.
Explain about Set
interface?
140.
Explain about SortedSet
interface?
141.
Explain about
NavigableSet ?
142.
Explain about Queue
interface?
143.
Explain about Map
interface?
144.
Explain about SortedMap
?
145.
Explain about
NavigableMap?
146.
Explain about ArrayList
class?
147.
What is RandomAccess
Interface?
148.
Explain about
LinkedList class?
149.
Explain about Vector
class?
150.
What is difference
between ArrayList and Vector?
151.
How we can get
synchronized version of ArrayList?
152.
What is difference
between size and capacity of a Collection Object?
153.
What is difference
between ArrayList and Linked List?
154.
What are legacy classes
and interfaces present in Collections framework?
155.
What is difference
Enumeration and Iterator?
156.
What are limitations of
Enumeration?
157.
What is difference
between enum and Enumeration?
158.
What is difference
between Iterator and ListIterator?
159.
What is relation
between ListIterator and Iterator?
160.
Explain about HashSet class?
161.
If we are trying to
insert duplicate values in Set what will happen?
162.
What is LinkedHashSet?
163.
Differences
between HashSet and LinkedHashSet?
164.
Explain about TreeSet?
165.
What are differences
between List and Set interfaces?
166.
What is Comparable
interface?
167.
What is Comparator
interface?
168.
What are differences
between Comparable and Comparator?
169.
What is difference
between HashSet and TreeSet?
170.
What is Entry interface
171.
Explain about HashMap?
172.
Explain about
LinkedHashMap?
173.
Differences between
HashMap and LinkedHashMap ?
174.
Differences between
HashMap and Hashtable?
175.
What is
IdentityHashMap?
176.
What is TreeMap?
177.
What is Hashtable?
178.
Why ArrayList is faster
than Vector?
179.
What is introspection
in java?
180.
What is a reflection?
How can you achive in java?
181.
What is resource
bundle?
182.
Which thread always runs in a java program by
default?
183.
Why threads are
called light_weight?
184.
How can you stop a
thread in java?
185.
Which method is
executed by the thread by default?
186.
What is the difference
between synchronized block and synchronized keyword?
187.
What is thread
deadlock?
188.
What is difference
between the sleep() and wait() methods?
189.
What is default
priority of a thread?
190.
What is a daemon
thread?
191.
What is thread life
cycle?
192.
What is the difference
between extends thread and implements runnable? Which one is advantageous?
193.
How to create a thread?
194.
What is serialization?
195.
What is
externalization?
196.
How to prevent
serialization?
197.
What is wrapper class?
198.
What is difference
between int and Integer?
199.
Objects are passed by
value or passed by reference?
200.
Primitive data types
are passed by value or passed by reference?
201.
What is difference
between shallow copy and deep copy?