JAVA Sample QUESTIONS
1. What is an object.
2. What is a class.
3. Polymorphism examples.Two types of
polymorphism.
4. Over riding. Over loading difference.
5. Abstraction ,Encapsulation.
6. Inheritance.
7. OOPs.
8. Java features.
9. Web browser and different web browsers.
10. Minimum requirements of java.
11. APIs egs.
12. Commands for compiling and executing.
13. What will be generated if you compile a program.
14. Syntax for class declaration.
15. Syntax for creating an object.
16. How do you call a method(using what)? Syntax of calling a
method.
17. Syntax of writing a main() function. Explain each keyword in
that statement.
18. Command which is used to print a message on screen.
19. Identifiers and rules for defining them.
20. JVM(Java Virtual Machine).
21. Explain what are command line arguments. Where do you pass them.
Write the syntax of passing those arguments.
22. What is variable, constant, datatype.
23. How many types of datatypes. Examples.
24. Ranges of datatypes.
25. How can you declare symbolic constants. And why.
26. What is difference between instance variables and class
variables.
27. What are locall and global variables.
28. What is type casting .Examples.How many types.Write the syntax
of casting them.
29. Operators. Different types.
30. Syntax of conditional operator. Explain.
31. Precedence of operators.(Which is highest and lowest
priorities).
32. What are collections.
33. If statements and types of if with syntax and explain
switch.
34. Difference between while and do-while loops in execution(How is
the execution from both)
35. Enhanced for loop with a sample example with explanation.
36. What are labeled loops. Jumping loops.
37. What are members , methods.How are they declared.(Should be
explained using classes)
38. What are the 2 steps involved in creating an object.(Declaration
and instantiation explanation).
39. How are the members of class accessed.
40. Example program of Method Overloading.
41. What are static members.
42. Inheritance concepts.Outline of a program which illustrates
inheritance.
43. What is a super class, sub class.What are other names given to
them.
44. What is over riding.
45. Final variables and method. Finalize r method.
46. What are abstract methods and classes.
47. Purpose of var-args. Syntax.
48. Different access-specifiers.
49. What are arrays. How do you declare an array?
50. What is an index. What is the other name of index.
51. Syntax of creating two-dimensional arrays.
52. Which is the class used to define a string variable.
53. What are various methods of stings. Explain with syntax.
54. Vector . How to declare them.
55. What are the different ways of converting numbers using
constructor methods.
56. Boxing and unboxing.
57. What are interfaces. How do you implement them. Syntax.
58. Different possible ways where the interface can be implemented.
59. What are packages. What are different predefined packages in the
system.
60. Explain the overall concept of how the packages are saved and
how do we import them.
61. What should be done to add a new class to an existing package.
62. Purpose of static import.
63. What is a thread. Explain the concept of multithreading.
64. Run() method.
65. How to create a new thread.(What are the two ways of creating).
66. Which method calls the run() method.
67. How can you block a thread, and method used to stop a thread?
68. How can you make a thread into runnable state from blocked
state?(methods used).
69. What are the different states where a thread can go into?
70. What does a yield() method do?
71. How can you set priorities to threads.(method used to set
priority)
72. Concept of synchronization.
73. What is dead lock.
74. Using Runnable Interface . What are the 4 steps involved in
using the interface.
75. Compile time and run time errors.
76. How can we handle run time errors.
77. Explain try and catch blocks.(what are the tasks done in each of
the block)
Need toi explain
‘hit’,’throw’,’catch’.
78. Name few commonly used exceptions and cause.
79. How does multiple catch statements work.
80. Use of finally statement.
81. How to throw our own exceptions. Explain with example(what is
the statement which is used throw such exceptions)
82. Applet definitions. How to run them. Few main differences
between an applet and a stand alone application.
83. Explain paint(), Graphics class, init(), start() methods.
84. What are packages needed to imported. What does that package
contain.(why do you import only those packages).
85. Different states of an applet. And methods called when an applet
is in that state.
86. Small applet code to define an applet.
87. Write a HTML code that calls an applet to execute.
88. Steps performed to run an applet.
89. Use of align attribute.
90. Explain some tags used in html.
91. What is the class which is used to insert a text box. Write the
syntax of entering a text box in applet.
92. How can you pass parameters in an applet.( what is the method
used).
93. All the questions based on an applet program which is asked for
you in your lab examination. i.e., All the new concepts that are used in your
program which you have executed.