RPSC Programmer Java DPP Part-4 By-Sunil Yadav Sir
RPSC Programmer Java DPP Part-4 By-Sunil Yadav Sir
RPSC Programmer Java DPP Part-4 By-Sunil Yadav Sir
{ int j; {
{System.out.println(j);} } obj.i=1;
{ obj.display();
{ (a) 1 2 (b) 2 1
A r; {
r.display(); } } {
class A }}
class B extends A
Q 8. Using which of the following, multiple
{ int j;
inheritance in Java can be implemented?
void display() {
(a) Interfaces (b) Multithreading
super.j = 3;
(c)Protected methods (d)Private methods
System.out.println(i + " " + j) }}
class Output {
Q 14. What is the output of this program? public static void main(String args[])
class exception_handling {
{ try
try }
catch(ArithmeticException e) {
{ System.out.print("World");
System.out.print("B"); }}}
(c)Compilation Error
Q 20. Which of these methods return description
(d) Runtime Error
of an exception?
Q 18. Which of these statements is incorrect?
(a) getException()
(a) try block need not to be followed by (b) getMessage()
catch block (c) obtainDescription()
(b) try block can be followed by finally block (d) obtainException()
instead of catch block
(c) try can be followed by both catch and
finally block
(d) try need not to be followed by anything
class Output
try
int a = 0;
int b = 5;
int c = a / b;
System.out.print("Hello");
catch(Exception e)