View Count: 0
Duration: 5 mins
Accessed date:
Not Yet Viewed
View Count: 0
Duration: 57 mins
Accessed date:
Not Yet Viewed
Post your comment / feedback here
 
 

Be the first one to comment about this video

Sorry!For this module there is no Sample Code.
Sorry!For this module there is no Assignments.
Question No: 1 of 12
What is an Exception? 
Options:
  1. Is a error
  2. Is a syntax error
  3. Is a logic error
  4. Is a runtime error
View Answer/Explanation:
d
Explanation:

Question No: 2 of 12
Why throw is use? 
Options:
  1. for handing an exception
  2. for handeling user defined exception
  3. To write multiple catch
  4. To avoid try and catch
View Answer/Explanation:
b
Explanation:
Explanation-Sometime user need to generate user defined exception.

Question No: 3 of 12
Which statement is correct? 
Options:
  1. Checked exceptions are handle are mention in throws list
  2. Unchecked exceptions are handle are mention in throws list
  3. Checked exceptions are should be handled by try catch.
  4. Checked exceptions are should be mentioned in throws list
View Answer/Explanation:
a
Explanation:

Question No: 4 of 12
Which one is the runtime exception? 
Options:
  1. FileNotFoundException
  2. IOException
  3. ArithmeticException
  4. InterruptedException
View Answer/Explanation:
c
Explanation:

Question No: 5 of 12
What is the output of this program?
public class MyMain

{

public static void main(String[] args)

{

System.out.print(“My first program...”);

try

{

System.out.print(“In try block”);

return;

}

finally

{

System.out.print( "Finally" );

}

}

} 
Options:
  1. Compile time error
  2. Run time error
  3. My first program In try block Finally
  4. My first program Exception
View Answer/Explanation:
c
Explanation:
Explanation: Try should contains Zero or more catch blocks . If try has Zero catch blocks finally is compulsory. The finally must execute after the try block .so we could get the all the print() statements mentioned in the program . These are the exceptional cases. • An exception rising in the finally block itself. • The death of the thread. • The use of System.exit() • Turning off the power to the CPU

Question No: 6 of 12
What is the output of this program?

try

{

int num1 = 0;

int num2 = 5 / num1;

}

catch (Exception error)

{

System.out.print("Exception");

}

catch (ArithmeticException error)

{

System.out.print("Arithmetic Exception");

}

System.out.print("finished");
}
} 
Options:
  1. Runtime error
  2. Compile time error
  3. Exception finished
  4. Arithmetic Exception finished
View Answer/Explanation:
b
Explanation:
Explanation: The exception has been coughed by Exception, so there is no scope for execute next so its just like unreachable code. It’s a compile time error.

Question No: 7 of 12
What is the output of the program?
public class MyExample

{

public static void main(String [] args)

{

try

{

nextMethod();

System.out.print("1");

}

catch (RuntimeException ex)

{

System.out.print("2");

}

catch (Exception ex1)

{

System.out.print("3");

}

finally

{

System.out.print("4");

}

System.out.print("5");

}

public static void nextMethod ()

{

throw new RuntimeException();

}

} 
Options:
  1. 145
  2. 245
  3. 135
  4. 245
View Answer/Explanation:
d
Explanation:

Question No: 8 of 12
What is the output of this program?
public class MyRunttimeException

{

public static void main(String [] args)

{

try

{

System.out.print("main starts ");

throwExp() ;

}

catch (Exception re )

{

System.out.print("Exception catches ");

}

finally

{

System.out.print("in finally block ");

}

System.out.println("program ends");

}

public static void throwExp ()

{

System.out.print("throwExp method");

throw new RuntimeException();

}

} 
Options:
  1. main starts throwExp method Exception catches in finally block program ends
  2. Compilation fails
  3. main starts throwExp method RuntimeException
  4. main starts throwExp method in finally block program ends
View Answer/Explanation:
a
Explanation:

Question No: 9 of 12
What is import static in java? 
Options:
  1. It is possible to refer static members along with the class
  2. It is possible to refer to static members of a class without class name.
  3. It is possible to refer to instance variable without create object
  4. It is possible to refer to instance variable with create object
View Answer/Explanation:
b
Explanation:
Explanation-It can be used by using variables of a class.

Question No: 10 of 12
What is the use of java.lang.Class class? 
Options:
  1. is used to represent the classes and interfaces that are loaded by a java program.
  2. is used to represent the classes and interfaces that are loaded by a java program.
  3. Is used to represents the native methods in java
  4. None of this above
View Answer/Explanation:
a
Explanation:

  1