113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
Explain with a code sample how to create a package.
Name some default packages
in JDK and explain what they
do in brief.
Is the following code valid? Explain the reasons.
Explain the import keyword.
Explain the differences between
the protected and default
access specifier.
Is the following code snippet valid? Explain.
Explain what happens when the
following code is compiled
and executed:
Explain the java.lang package.
Excep on Handling
Explain ‘throw’, ‘throws’ and ‘Throwable’ in Java.
What will be the output when
you compile and execute the
following code?
Write a code sample that demonstrates the try/catch/finally
block:
What will be the output on executing the code below?
Explain the try–catch–finally statement in Java.
What will be the output of the following code snippet?
Suppose you have a method
called myMethod with some
code that can throw a checked Exception.
How will you handle
this in the code?
What is the use of “finally” clause? Give an example.
Explain the differences between Error and Exception.
What is a RuntimeException?