CONTENTS
Java Basics
1. What is the difference between JDK and JRE?
What is Java Virtual Machine (JVM)?
What are the different types of memory areas allocated by JVM?
What is JIT compiler?
How Java platform is different from other platforms?
Why people say that Java is 'write once and run anywhere’ language?
How does ClassLoader work in Java?
Do you think ‘
jin’ used for main method is a keyword in Java?
ee aA Ae EP
. Can we write main method as public void static instead of public static
void?
10. In Java, if we do not specify any value for local variables, then what
will be the default value of the local variables?
11. Let say, we run a java class without passing any arguments. What will
be the value of String array of arguments in Main method?
12. What is the difference between byte and char data types in Java?
OOPS
13. What are the main principles of Object Oriented Programming?
14, What is the difference between Object Oriented Programming
language and Object Based Programming language?
15. In Java what is the default value of an object reference defined as aninstance variable in an Object?
16.
17.
18.
19.
Why do we need constructor in Java?
Why do we need default constructor in Java classes?
What is the value returned by Constructor in Java?
Can we inherit a Constructor?
20. Why constructors cannot be final, sta or abstract in Java?
Inheritance
21. What is the purpose of ‘this’ keyword in java?
22.
23.
24,
25.
26.
27.
28.
Explain the concept of Inheritance?
Which class in Java is superclass of every other class?
Why Java does not support multiple inheritance?
In OOPS, what is meant by composition?
How aggregation and composition are different concepts?
Why there are no pointers in Java?
If there are no pointers in Java, then why do we get
NullPointerException?
29.
30.
31.
What is the purpose of ‘super’ keyword in java?
Is it possible to use this() and super() both in same constructor?
What is the meaning of object cloning in Java?
Static
32.
33,
34,
In Java, why do we use static variable?
Why it is not a good practice to create static variables in Java?
What is the purpose of static method in Java?35. Why do we mark main method as static in Java?
36. In what scenario do we use a static block?
37. Is it possible to execute a program without defining a main() method?
38. What happens when static modifier is not mentioned in the signature
of main method?
39. What is the difference between static method and instance method in
Java?
Method Overloading and Overriding
40. What is the other name of Method Overloading?
41. How will you implement method overloading in Java?
42. What kinds of argument variations are allowed in Method
Overloading?
43. Why it is not possible to do method overloading by changing return
type of method in java?
44. Is it allowed to overload main() method in Java?
45. How do we implement method overriding in Java?
46. Are we allowed to override a static method in Java?
47. Why Java does not allow overriding a static method?
48. Is it allowed to override an overloaded method?
49. What is the difference between method overloading and method
overriding in Java?
50. Does Java allow virtual functions?
51. What is meant by covariant return type in Java?
Polymorphism52. What is Runtime Polymorphism?
53. Is it possible to achieve Runtime Polymorphism by data members in
Java?
54. Explain the difference between static and dynamic binding?
Abstraction
55. What is Abstraction in Object Oriented programming?
56. How is Abstraction different from Encapsulation?
57. What is an abstract class in Java?
58. Is it allowed to mark a method abstract method without marking the
class abstract?
59. Is it allowed to mark a method abstract as well as final?
60. Can we instantiate an abstract class in Java?
61. What is an interface in Java?
62. Is it allowed to mark an interface method as static?
63. Why an Interface cannot be marked as final in Java?
64, What is a marker interface?
65. What can we use instead of Marker interface?
66. How Annotations are better than Marker Interfaces?
67. What is the difference between abstract class and interface in Java?
68. Does Java allow us to use private and protected modifiers for
variables in interfaces?
69. How can we cast to an object reference to an interface reference?
Final