120 TOP Advanced Java Interview Questions and answers for freshers pdf

Advanced Java Interview Questions and answers pdf for freshers and experienced
1.  What is a transient variable?
2.  Which containers use a border Layout as their default layout?
3.  Why do threads block on I/O?
4.  How are Observer and Observable used?
5.  Is null a keyword?
6.  What is the preferred size of a component?
7.  Which containers use a FlowLayout as their default layout?
8.  What state does a thread enter when it terminates its processing?
9.  What is the Collections API?
10. Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
11. What is the List interface?
12. How does Java handle integer overflows and underflows?
13. What is the Vector class?
14. What modifiers may be used with an inner class that is a member of an outer class?
15. What is an Iterator interface?
16. What is the difference between the >> and >>> operators?
17. Which method of the Component class is used to set the position and size of a component?
18. What is the difference between yielding and sleeping?
19. Which javutil classes and interfaces support event handling?
20. Is sizeof a keyword?
21. What are wrapped classes?
22. Does garbage collection guarantee that a program will not run out of memory?
23. What restrictions are placed on the location of a package statement within a source code file?
24. What is the immediate superclass of the Applet class?
25. What is the difference between preemptive scheduling and time slicing?
26. Name three Component subclasses that support painting?
27. What value does readLine() return when it has reached the end of a file?
28. What is the immediate superclass of the Dialog class?
29. What is clipping?
30. What is a native method?
31. Can a for statement loop indefinitely?
32. Can an objects finalize() method be invoked while it is reachable?
33. What method is used to specify a containers layout?
34. Whats new with the stop(), suspend() and resume() methods in JDK 1.2?
35. What is synchronization and why is it important?
36. Can a lock be acquired on a class?
37. What are order of precedence and associativity, and how are they used?
38. When a thread blocks on I/O, what state does it enter?
39. To what value is a variable of the String type automatically initialized?
40. What is the catch or declare rule for method declarations?
41. What is the difference between a MenuItem and a CheckboxMenuItem?
42. What is a tasks priority and how is it used in scheduling?
43. What class is the top of the AWT event hierarchy?
44. When a thread is created and started, what is its initial state?
45. Can an anonymous class be declared as implementing an interface and extending a class?
46. What is the immediate superclass of Menu?
47. What is the purpose of finalization?
48. Which class is the immediate superclass of the MenuComponent class?
49. What invokes a threads run() method?
50. What is the difference between the Boolean & operator and the && operator?
51. Name three subclasses of the Component class?
52. What is the GregorianCalendar class?
53. Which Container method is used to cause a container to be laid out and redisplayed?
54. What is the purpose of the Runtime class?
55. How many times may an objects finalize() method be invoked by the garbage collector?
56. What is the purpose of the finally clause of a try-catch-finally statement?
57. What is the argument type of a programs main() method?
58. Which Java operator is right associative?
59. Can a double value be cast to a byte?
60. What must a class do to implement an interface?
61. What method is invoked to cause an object to begin executing as a separate thread?
62. Name two subclasses of the TextComponent class?
63. Which containers may have a MenuBar?
64. How are commas used in the intialization and iteration parts of a for statement?
65. What is the purpose of the wait(), notify(), and notifyAll() methods?
66. What is an abstract method?
67. What is the relationship between the Canvas class and the Graphics class?
68. What are the high-level thread states?
69. How are Java source code files named?
70. What value does read() return when it has reached the end of a file?
71. Can a Byte object be cast to a double value?
72. What is the difference between a static and a non-static inner class?
73. What is the difference between the String and StringBuffer classes?
74. If a variable is declared as private, where may the variable be accessed?
75. What is an objects lock and which objects have locks?
76. What is the Dictionary class?
77. How are the elements of a BorderLayout organized?
78. What is the % operator?
79. Explain different way of using thread?
80. Difference between Swing and Awt?
81. Difference between HashMap and HashTable?
82. What is HashMap and Map?
83. What is final?
84. What if the main method is declared as private?
85. What if the static modifier is removed from the signature of the main method?
86. What if I write static public void instead of public static void?
87. What if I do not provide the String array as the argument to the method?
88. Can I have multiple main methods in the same class?
89. Do I need to import javlang package any time? Why ?
90. Can I import same package/class twice? Will the JVM load the package twice at runtime?
91. What is the default value of an object reference declared as an instance variable?
92. When can an object reference be cast to an interface reference?
93. What is the difference between a Window and a Frame?
94. Which class is extended by all other classes?
95. Can an object be garbage collected while it is still reachable?
96. Is the ternary operator written x : y ? z or x ? y : z ?
97. What is the difference between the Font and FontMetrics classes?
98. How is rounding performed under integer division?
99. What happens when a thread cannot acquire a lock on an object?
100. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
101. What classes of exceptions may be caught by a catch clause?
102. If a class is declared without any access modifiers, where may the class be accessed?
103. What is the SimpleTimeZone class?
104. What is the Map interface?
105. Does a class inherit the constructors of its superclass?
106. For which statements does it make sense to use a label?
107. What is the purpose of the System class?
108. Which TextComponent method is used to set a TextComponent to the read-only state?
109. How are the elements of a CardLayout organized?
110. Is &&= a valid Java operator?
111. Name the eight primitive Java types.
112. Which class should you use to obtain design information about an object?
113. What is the relationship between clipping and repainting?
114. Is “abc” a primitive value?
115. What is the relationship between an event-listener interface and an event-adapter class?
116. What restrictions are placed on the values of each case of a switch statement?
117. What modifiers may be used with an interface declaration?
118. Is a class a subclass of itself?
119. What is the highest-level event class of the event-delegation model?
120. What event results from the clicking of a button?

0 comments: