IMPORTANT JAVA QUESTIONS
Reference: [Link]
questions
1. What is Java?
2. Explain the Java History.
3. What are the differences between C++ and Java?
4. Explain the features of JAVA programming Languages.
5. Where Java language is used?
6. Explain the different Java Platforms.
7. What is Java Virtual Machine?
8. What is the difference between JDK, JRE, and JVM?
9. Explain the Memory areas allocated by JVM?
10. Why java is called as Platform independent language?
11. Is Empty .java file name a valid source file name?
12. What if I write static public void instead of public static void?
13. What is the default value of the local variables?
14. Explain the difference between local, instance and global variable?
15. What are the different Access Specifiers used in Java?
16. What if I write static public void instead of public static void?
17. What is the use of static keyword in Java?
18. Can we override static methods?
19. What if the static modifier is removed from the signature of the main method?
20. Why is the main method static?
21. Can we have a Java program without main() method?
22. What is mean by Keyword, Identifier and variable in Java?
23. Which are the different data types are used in Java?
24. How to set java Path?
25. Explain java Array and its types.
26. How to declare, instantiate, Initialize and use single dimension as well as
multidimensional array?
27. Explain the different methods used in Array.
28. What is class and object?
29. Explain the different types of methods used in Java.
30. What is Garbage Collector?
31. What is the use of finalize() in Garbage collector?
32. What is Scanner class and what is its use in java?
33. Explain the different methods of Scanner class and its use.
34. What is nested class and inner class?
35. What is Object class? Explain the methods present inside object class.
36. What is String class? Explain how to create object of String class.
37. Explain the different methods used in String class.
38. What is Inheritance? Explain the types of Inheritance.
39. Why multiple inheritance is not used in Java?
40. Explain the use super and final keyword in Java.
41. What is final variable?
42. What is final class?
43. Can we declare main method as final?
44. Explain the difference between final, finalize() and fnally.
45. What is Abstract class and Abstract methods? Explain its uses in Java.
46. What is the constructor?
47. How many types of constructors are used in Java?
48. Does constructor return any value? Is constructor inherited?
49. Can you make a constructor final?
50. Can we overload the constructor?
51. What is difference between method and constructor?
52. What is this keyword in java? Explain the uses of this keyword.
53. What is Java interface?
54. What is Java Package?
55. What is Encapsulation? Explain the 4 pillars of Java programming language.
56. Why java is called as purely object oriented programming language?
57. What is mean by Exception? Explain how Exception is handled in Java.
58. What is nested try block?
59. Why Exception class is called as Generic Exception Handler?
60. Explain Java events and its types.
61. Explain difference between Event and Exception.
62. Explain the Exception Hierarchy.
63. What is the difference between checked exception and unchecked exception?
64. What is mean by Exception Propagation?
65. What is mean by custom exception?
66. What is the use of throwable class?
67. Differentiate between Throw and Throws keyword.
68. Is it necessary that each try block must be followed by a catch block?
69. Explain the different states of Thread.
70. What is finally Block?
71. Can finally Block be used without a catch Block?
72. What are the advantages of defining packages in Java?
73. How to create package in java?
74. Do I need to import [Link] package in my java program? Why?