What will be the output of the following Java program? class exception_handling ...
View QuestionWhich of these class is used to create user defined exception?
a) java.lang b) Exception c) RunTime d) System Answer: b Explanation: ...
View QuestionWhich of these exceptions will be thrown if we use null reference for an arithmetic operation?
a) ArithmeticException b) NullPointerException c) IllegalAccessException d) IllegalOperationException Answer: b Explanation: If we use null ...
View QuestionWhich of these packages contain all the Java’s built in exceptions?
a) java.io b) java.util c) java.lang d) java.net Answer: c Explanation: java.lang
View QuestionWhich of these exceptions will be thrown if we declare an array with negative size?
a) IllegalArrayException b) IllegalArraySizeExeption c) NegativeArrayException d) NegativeArraySizeExeption Answer: d Explanation: Array size must always be ...
View QuestionWhich of these exceptions handles the situations when an illegal argument is used to invoke a method?
a) IllegalException b) Argument Exception c) ...
View QuestionThe same import package/class be called twice in java?
a) true b) false Answer: a Explanation: We can import the same package or same class ...
View QuestionWhere is String Pool stored?
a) Java Stack b) Java Heap c) Permanent Generation d) Metaspace Answer: b Explanation: When a string is created; ...
View QuestionClasses and Methods are stored in which space?
a) Eden space b) Survivor space c) Tenured space d) Permanent space Answer: d Explanation: The permanent generation holds ...
View QuestionWhat is the Java 8 update of PermGen?
a) Code Cache b) Tenured Space c) Metaspace d) Eden space Answer: c Explanation: Metaspace is the replacement ...
View Question