You are on page 1of 1

Java Questions

Time: 45min
1. What if I do not provide the String array as the agrument to
the main method?
2. Can an application have multiple classes having main method?
Justify.
3. Can I have multiple main methods in the same class?
4. What if I write static public void instead of public static void?
5. What are the different ways to handle exceptions?
6. What are checked exceptions?
7. How are this and super used with constructors?
8. What class allows you to read objects directly from a stream?
9. Write the JDBC Connection String for Oracle database.
10.
Write a simple program to read a file by using Character
Stream.
11.
Can you call one constructor from another?
12.
When is a method said to be overloaded and when is a
method said to be overridden?
13.
Explain different ways of creating a thread.
14.
Which is true?
a. X exends Y is correct if and only if X is a class and Y is
an interface
b. X exends Y is correct if and only if X is an interface and
Y is a class
c. X exends Y is correct if X and Y are either both classes
or both interfaces
d. X exends Y is correct for all combination of X and Y
being classes and/or interfaces
15. Write a program for Class casting with 3 classes(A,B,C).

You might also like