You are on page 1of 3

JAVA INTERVIEW QUESTIONS

Note – Need to complete before 30-Nov

1. What is Java?
2. What are the differences between C++ and Java?
3. List the features of Java Programming language.
4. What do you understand by Java virtual machine?
5. What is the difference between JDK, JRE, and JVM?
6. What is the platform?
7. What gives Java its 'write once and run anywhere' nature?
8. Is delete, next, main, exit or null keyword in java?
9. If I don't provide any arguments on the command line, then what will the value
stored in the String array passed into the main() method, empty or NULL?
10. What if I write static public void instead of public static void?
11. What is the default value of the local variables?
12. What are the various access specifiers in Java?
13. What is the purpose of static methods and variables?
14. What are the advantages of Packages in Java?
15. What is the output of the following Java program?
a. class Test
b. {
i. public static void main (String args[])
ii. {
iii. for(int i=0; 0; i++)
iv. {
v. System.out.println("Hello Javatpoint");
vi. }
vii. }
c. }
16. What is an object?
17. What is the difference between an object-oriented programming language and
object-based programming language?
18. What will be the initial value of an object reference which is defined as an
instance variable?
19. What is the constructor?
20. How many types of constructors are used in Java?
21. Does constructor return any value?
22. Is constructor inherited?
23. Can you make a constructor final?
24. Can we overload the constructors?
25. What are the differences between the constructors and methods?
26. What is the static variable?
27. What is the static method?
28. What are the restrictions that are applied to the Java static methods?
29. Why is the main method static?
30. Can we override the static methods?
31. What is the static block?
32. Can we execute a program without main() method?
33. What if the static modifier is removed from the signature of the main method?
34. What is the difference between static (class) method and instance method?
35. Can we make constructors static?
36. Can we make the abstract methods static in Java?
37. Can we declare the static variables and methods in an abstract class?
38. What is this keyword in java?
39. How can constructor chaining be done using this keyword?
40. What is the Inheritance?
41. Why is Inheritance used in Java?
42. Which class is the superclass for all the classes?
43. Why is multiple inheritance not supported in java?
44. What is super in java?
45. What are the differences between this and super keyword?
46. Can you use this() and super() both in a constructor?
47. What is method overloading?
48. Why is method overloading not possible by changing the return type in java?
49. Can we overload the methods by making them static?
50. Can we overload the main() method?
51. What is method overriding:
52. Can we override the static method?
53. Why can we not override static method?
54. Can we override the overloaded method?
55. Difference between method Overloading and Overriding.
56. Can we override the private methods?
57. Can we change the scope of the overridden method in the subclass?
58. What is covariant return type?
59. What is the final variable?
60. What is the final method?
61. What is the final class?
62. Can you declare the main method as final?
63. Can we declare a constructor as final?
64. Can we declare an interface as final?
65. What is the difference between the final method and abstract method?
66. What is the difference between compile-time polymorphism and runtime
polymorphism?
67. What is Runtime Polymorphism?
68. Can you achieve Runtime Polymorphism by data members?
69. What is the difference between static binding and dynamic binding?
70. What is the abstraction?
71. What is the difference between abstraction and encapsulation?
72. What is the abstract class?
73. Can there be an abstract method without an abstract class?
74. Can you use abstract and final both with a method?
75. Is it possible to instantiate the abstract class?
76. What is the interface?
77. Can you declare an interface method static?
78. Can the Interface be final?
79. What is a marker interface?
80. What are the differences between abstract class and interface?
81. Can we define private and protected modifiers for the members in interfaces?
82. How to make a read-only class in Java?
83. How to make a write-only class in Java?
84. What are the advantages of Encapsulation in Java?
85. What is the package?
86. What is the difference between final, finally and finalize?

You might also like