Sie sind auf Seite 1von 4

www.jntuworld.

com

1
Java VIVA Questions
1. Why java is Secured Compare with other Language?
2. What if the main method is declared as private?
3. What if the static modifier is removed from the signature of the main
method?
4. What if I write static public void instead of public static void?
5. What if I do not provide the String array as the argument to the
method?
6. What is the first argument of the String array in main method?
7. If I do not provide any arguments on the command line, then the
String array of Main method will be empty or null?
8. What environment variables do I need to set on my machine in order

m
to be able to run Java programs?
9. Can an application have multiple classes having main method?
10. In how many Ways we can create a Object in java?

. c o
11. Every Application Should ve a main() Method under which class does

ld
the main() Method come Under?
12. What is Difference Between Static And Dynamic Polymarphism?

14. Can we Override the Main() Method?


o r
13. What happens If public Static void main() is made protected?

File to byte code?

tu w
15. What is the name of the java Complier used to compile the Source

16. what is the use of static data member?

j. n
17. What does "wrapping" an object mean?
18. What is the difference between a while statement and a
do statement?

w w
19. What is Constructor?
20. How are this() and super() used with constructors?

w
21. What is Difference between the Constructor and the Method?
22. What is the need of calling Default Constructor?
23. What is Difference between Instance and the Object?
24. What is System.Out.Println means?
25. What is JTI (Just in time) Engine means?
26. What is Differences Between Static & Final?
27. What is the difference between static and non-static
variables?
28. What is Differences Between class and Package?
29. What is String class? 1
30. What is Scanner Class in java?
www.jntuworld.com

2
Java VIVA Questions
31. What will a Static Variables is loaded ? Is at Compile time or Run
Time
32. What are the Primitive Types in java?
33. What is the difference between an Interface and an Abstract class?
34. What is the purpose of garbage collection in Java, and when is it
used?
35. What is the difference between a constructor and a method?
36. What is an Iterator?
37. State the significance of public, private, protected, default modifiers
both singly and in combination and state the effect of package
relationships on declared items qualified by these modifiers.

m
38. What is an abstract class?
39. What is static in java?
40. What is final ?
41. What are pass by reference and passby value?
. c o
ld
42. Can I have multiple main methods in the same class?
43. How can one prove that the array is not null but empty using one line
of code?

o r
44. Do I need to import java.lang package any time? Why ?

tu
package twice at runtime?
w
45. Can I import same package/class twice? Will the JVM load the

46. What are Checked and UnChecked Exception?

j. n
47. What is Overriding?
48. What are different types of inner classes?
49. Does Java provide any construct to find out the size of an object?

w w
50. What are wrapper classes?
51. Why do we need wrapper classes?

w
52. What are checked exceptions?
53. What are runtime exceptions?
54. What is the difference between error and an exception?? Question:
How to create custom exceptions?
55. If I want an object of my class to be thrown as an exception object,
what should I do?
56. If my class already extends from some other class what should I do if
I want an instance of my class to be thrown as an exception object?
57. How does an exception permeate through the code?
58. What are the different ways to handle exceptions? 2
59. What is the basic difference between the 2 approaches to exception
handling...1> try catch block and 2> specifying the candidate
exceptions in the throws clause hen should you use which approach?
www.jntuworld.com

3
Java VIVA Questions
60. Is it necessary that each try block must be followed by a catch block?
61. If I write return at the end of the try block, will the finally block still
execute?If I write System.exit (0); at the end of the try block, will the
finally block still execute?
62. Are the imports checked for validity at compile time? e.g. will the
code containing an import such as java.lang.ABCD compile?
63. Does importing a package imports the subpackages as well? e.g. Does
importing com.MyTest.* also import com.MyTest.UnitTests.*?
64. What is the difference between declaring a variable and defining a
variable?
65. What is the default value of an object reference declared as an

m
instance variable?
66. Can a top level class be private or protected?
67. What type of parameter passing does Java support?

. c
68. Primitive data types are passed by reference or pass by value? o
ld
69. Objects are passed by value or by reference?
70. What is serialization?
71. How do I serialize an object to a file?

o r
72. What happens to the static fields of a class during serialization?

tu w
73. Describe synchronization in respect to multithreading.
74. Explain different way of using thread?
75. What is HashMap and Map?

j. n
76. Difference between HashMap and HashTable?
77. Difference between Vector and ArrayList?
78. Difference between Swing and Awt?

w w
79. What is synchronization and why is it important?
80. Does garbage collection guarantee that a program will

w not run out of


memory?
81. How does Java handle integer overflows and
underflows?
82. What is the difference between preemptive scheduling
and time slicing?
83. When a thread is created and started, what is its initial
state?
84. What is the purpose of finalization?
3
85. What is the Locale class?
86. What are synchronized methods and synchronized
statements?
www.jntuworld.com

4
Java VIVA Questions
87. What is daemon thread and which method is used to create the
daemon thread?
88. Can applets communicate with each other?

o m
. c
r ld
w o
j. n tu
w w
w
4

Das könnte Ihnen auch gefallen