Questions and Answers
Who generates the Exceptions?
The programmer
What is an exception in Java?
An object representing an exceptional condition
What happens when an exception is thrown in Java?
The method that caused the error is terminated
Which of the following constructors for creating object of type wrappers is now deprecated?
Signup and view all the answers
What is the return type of the static method parseFloat()?
Signup and view all the answers
Which method provides additional functionalities to deal with individual data types in wrapper classes?
Signup and view all the answers
Which class is used for exceptional conditions that user programs should catch?
Signup and view all the answers
What is an important subclass of Exception?
Signup and view all the answers
What happens when the Java run-time system detects an attempt to divide by zero?
Signup and view all the answers
What is the purpose of a catch clause in a try-catch block?
Signup and view all the answers
Which statement about creating custom exception types is correct?
Signup and view all the answers
What does the Exception class provide?
Signup and view all the answers
What is the purpose of packages in Java?
Signup and view all the answers
What is the default access level for a member that does not have an explicit access specification?
Signup and view all the answers
Which statement accurately describes the behavior of a nested try statement in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the throw statement in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the throws clause in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the finally block in Java?
Signup and view all the answers
Which of the following is NOT a primitive type in Java?
Signup and view all the answers
Which of the following is a type wrapper in Java?
Signup and view all the answers
What is the process of encapsulating a value within an object called?
Signup and view all the answers
What is the output of the following code?
Integer iOb = 100;
int i = iOb;
System.out.println(i + " " + iOb);
Signup and view all the answers
Who is responsible for handling exceptions in Java?
Signup and view all the answers
What is an exception in Java?
Signup and view all the answers
What does Java's exception handling bring to the object-oriented world?
Signup and view all the answers
Which method is now deprecated for creating objects of type wrappers in Java?
Signup and view all the answers
What is the purpose of the static method valueOf() in wrapper classes in Java?
Signup and view all the answers
Which method is used to parse a string and return a float value in the Float wrapper class in Java?
Signup and view all the answers
Which of the following is NOT a type wrapper in Java?
Signup and view all the answers
What is the purpose of autoboxing in Java?
Signup and view all the answers
Which of the following is NOT a method provided by the Number class in Java?
Signup and view all the answers
What is the output of the following code?
Integer iOb = 100;
int i = iOb;
System.out.println(i + " " + iOb);
Signup and view all the answers
Which class defines the exceptions that are not expected to be caught by your program?
Signup and view all the answers
What happens when the Java run-time system detects an attempt to divide by zero?
Signup and view all the answers
What is the purpose of the catch clause in a try-catch block?
Signup and view all the answers
What is the behavior of multiple catch clauses in a try-catch block?
Signup and view all the answers
Which statement accurately describes the behavior of the throws clause in Java?
Signup and view all the answers
What is the purpose of a catch clause in a try-catch block?
Signup and view all the answers
What is the purpose of packages in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the finally block in Java?
Signup and view all the answers
Which statement accurately describes the purpose of creating custom exception types in Java?
Signup and view all the answers
Which statement accurately describes the purpose of packages in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the throws clause in Java?
Signup and view all the answers
Which statement accurately describes the behavior of the throw statement in Java?
Signup and view all the answers