160 TOP Core Java Interview Questions and Answers for Freshers and Experienced pdf free download

Core Java Basic Interview Questions

1)  what are static blocks and static initalizers in Java ?
2)  How to call one constructor from the other constructor ?
3)  What is method overriding in java ?
4)  What is super keyword in java ?
5)  Difference between method overloading and method overriding in java ?
6)  Difference between abstract class and interface ?
7)  Why java is platform independent?
8)  What is method overloading in java ?
9)  What is difference between c++ and Java ?
10) What is JIT compiler ?
11) What is bytecode in java ?
12) Difference between this() and super() in java ?
13) What is a class ?
14) What is an object ?
15) What is method in java ?
16) What is encapsulation ?
17) Why main() method is public, static and void in java ?
18) Explain about main() method in java ?
19) What is constructor in java ?
20) What is difference between length and length() method in java ?
21) What is ASCII Code?
22) What is Unicode ?
23) Difference between Character Constant and String Constant in java ?
24) What are constants and how to create constants in java?
25) Difference between ‘>>’ and ‘>>>’ operators in java?


Coding Standards Interview Questions

26) Explain Java Coding Standards for classes or Java coding conventions for classes?
27) Explain Java Coding standards for interfaces?
28) Explain Java Coding standards for Methods?
29) Explain Java Coding Standards for variables ?
30) Explain Java Coding Standards for Constants?
31) Difference between overriding and overloading in java?
32) What is ‘IS-A ‘ relationship in java?
33) What is ‘HAS A’’ relationship in java?
34) Difference between ‘IS-A’ and ‘HAS-A’ relationship in java?
35) Explain about instanceof operator in java?
36) What does null mean in java?
37) Can we have multiple classes in single file ?
38) What all access modifiers are allowed for top class ?
39 ) What are packages in java?
40) Can we have more than one package statement in source file ?
41) Can we define package statement after import statement in java?
42) What are identifiers in java?
43) What are access modifiers in java?
44) What is the difference between access specifiers and access modifiers in java?
45) What access modifiers can be used for class ?
46) Explain what access modifiers can be used for methods?
47) Explain what access modifiers can be used for variables?
48) What is final access modifier in java?
49) Explain about abstract classes in java?
50) Can we create constructor in abstract class ?
51) What are abstract methods in java?


Java Exception Handling Interview questions

52) What is an exception in java?
53) State some situations where exceptions may arise in java?
54) What is Exception handling in java?
55) What is an error in Java?
56) What are advantages of Exception handling in java?
57) In how many ways we can do exception handling in java?
58) List out five keywords related to Exception handling ?
59) Explain try and catch keywords in java?
60) Can we have try block without catch block?
61) Can we have multiple catch block for a try block?
62) Explain importance of finally block in java?
63) Can we have any code between try and catch blocks?
64) Can we have any code between try and finally blocks?
65) Can we catch more than one exception in single catch block?
66) What are checked Exceptions?
67) What are unchecked exceptions in java?
68) Explain differences between checked and Unchecked exceptions in java?
69) What is default Exception handling in java?
70) Explain throw keyword in java?
71) Can we write any code after throw statement?
72) Explain importance of throws keyword in java?
73) Explain the importance of finally over return statement?
74) Explain a situation where finally block will not be executed?
75) Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
76) What are user defined exceptions?
77) Can we rethrow the same exception from catch handler?
78) Can we nested try statements in java?
79) Explain the importance of throwable class and its methods?
80) Explain when ClassNotFoundException will be raised ?
81) Explain when NoClassDefFoundError will be raised ?
83) What is process ?


Java Interview questions on threads

84) What is thread in java?
85) Difference between process and thread?
86) What is multitasking ?
87) What are different types of multitasking?
88) What are the benefits of multi thread programming?
89) Explain thread in java?
90) List Java API that supports threads?
91) Explain about main thread in java?
92) In how many ways we can create threads in java?
93) Explain creating threads by implementing Runnable class?
94) Explain creating threads by extending Thread class ?
95) Which is the best approach for creating thread ?
96) Explain the importance of thread scheduler in java?
97) Explain the life cycle of thread?
98) Can we restart a dead thread in java?
99) Can one thread block the other thread?
100) Can we restart a thread already started in java?
101) What happens if we don’t override run method ?
102) Can we overload run() method in java?
105) What is a lock or purpose of locks in java?
106) In how many ways we can do synchronization in java?
107) What are synchronized methods ?
108) When do we use synchronized methods in java?
109) When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
110) When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
111) What are synchronized blocks in java?
112) When do we use synchronized blocks and advantages of using synchronized blocks?
113) What is class level lock ?
114) Can we synchronize static methods in java?
115) Can we use synchronized block for primitives?
116) What are thread priorities and importance of thread priorities in java?
117) Explain different types of thread priorities ?
118) How to change the priority of thread or how to set priority of thread?
119) If two threads have same priority which thread will be executed first ?
120) What all methods are used to prevent thread execution ?
121) Explain yield() method in thread class ?
122) Is it possible for yielded thread to get chance for its execution again ?
123) Explain the importance of join() method in thread class?
124) Explain purpose of sleep() method in java?
125) Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
126) Can sleep() method causes another thread to sleep?
127) Explain about interrupt() method of thread class ?
128) Explain about interthread communication and how it takes place in java?
129) Explain wait(), notify() and notifyAll() methods of object class ?
130) Explain why wait() , notify() and notifyAll() methods are in Object class rather than in thread class?


Interview questions on Nested classses and inner classes

139) What are nested classes in java?
140) What are inner classes or non static nested classes in java?
141) Why to use nested classes in java?
142) Explain about static nested classes in java?
143) How to instantiate static nested classes in java?
144) Explain about method local inner classes or local inner classes in java?
145) Explain about features of local inner class?
146) Explain about anonymous inner classes in java?
147) Explain restrictions for using anonymous inner classes?
148) Is this valid in java ? can we instantiate interface in java?
149) Explain about member inner classes?
150) How to instantiate member inner class?
151) How to do encapsulation in Java?
152) What are reference variables in java?
153) Will the compiler creates a default constructor if I have a parameterized constructor in the class?
154) Can we have a method name same as class name in java?
155) Can we override constructors in java?
156) Can Static methods access instance variables in java?
157) How do we access static members in java?
158) Can we override static methods in java?
159) Difference between object and reference?
160) Objects or references which of them gets garbage collected?

0 comments: