Professional Documents
Culture Documents
12th Computer CH-10-1651889757
12th Computer CH-10-1651889757
:12th EC
10.1 Introduction
Here students can understand what is error. And types of errors
1. It is usually understood that a compiled program is error free and will always _____successfully.
A Complete B execute
C Perform D accomplish
2. In few cases a complied program can _____while it its executing.
A terminate B finish
C dismiss D discharge
3. The _____ in a program results in an abnormal execution and it may lead to abnormal termination of
the program.
A exception B error
C message D mistake
4. An _____ is an indication of a problem that occurs during a program’s execution.
A exception B inaccuracy
C error D e- fault
5. An exception usually signals an _____.
A exception B inaccuracy
C error D e-fault
6. Although exceptions occur infrequently, one has to be careful in handing such cases while writing
the_____.
A program B message
C data D code
7. _____handing allows a program to continue executing as if no problem had been encountered or it may
notify the user of the problem before terminating in an uncontrolled manner.
A Data B Program
C Error D Exception
8. There are few standard _____ available in Java, a technique to guarantee that a particular block of code
will always be executed, even if exceptions are present in our program.
A data info B programs
C errors D exceptions
9. In Java, all kinds of error conditions are called _____.
A methods B programs
C errors D exceptions
10. Errors can be broadly classified into _____ categories.
A four B three
C two D five
11. _____ is a type of error produced in java programs.
A Compile-time errors B Run-time errors
C Both (A) and (B) D None of these
12. A_____ is used to convert source code into object code.
A compiler B interpreter
C translator D decoder
13. A compiler is used to convert _____ code into object code.
A home B source
C beginning D program
14. If there is a syntax error in the program, a compilation error is displayed and _____file is not created.
A .source B .dat
C .class D .obj
15. Example of some common syntax errors are missing like a_____.
A semicolon B use of undeclared variable
C wrong spellings of identifier or D All of these
keyword
16. The Java _____suggests in an output, the type of error, along with the line number where the error has
occurred.
A compiler B interpreter
C translator D decoder
17. Compile-time _____are usually the mistake of a programmer and it dose not allow the program to
compile unless they are solved.
A methods B programs
C errors D exceptions
18. In the field of Computer Science, “Exit code’’ or “Exit status” indicates whether the command or a _____
executed successfully or not.
A data type B program
C error D method
19. Code _____indicates that the command executed successfully.
A 1 B -1
C 0.0 D 0
20. Code _____ indicates that some problem occurred while executing the command.
A 1 B -1
C 0.0 D 0
21. If there are no syntax errors in the source code then the program will compile successfully and will get
a_____ file.
A .source B .dat
C .class D .obj
22. The array “_____” citylist [ ] ={“Ahmedabad”, “Baroda’’, “Rajkot”, “Surat’’}contains name of four different
cities.
A String B int
C long D boolean
23. For each type of exception, there are corresponding _____ classes in Java.
A programs B exceptions
C java.lang D java.io
24. The _____contains a hierarchy of classes dealing with various exceptions.
A java.lang package B Java. io package
C both (A) and (B) D none of these
10.2 types of run time error
Here students can understand different types of runtime error.
25. An attempt to access the array element with an index value that is outside the range of array uses
_____Exception class.
A ArrayIndexOutOfBoundsException B ArithmeticException
C FileNotFoundException D All of these???
26. An attempt to divide any number by 0 uses _____ Exception class.
A ArrayIndexOutOfBoundsException B ArithemeticException
C FileNotFoundException D All of these
27. An attempt to access a non-existing file uses _____ Exception class.
A ArrayIndexOutOfBoundsException B ArithemeticException
C FileNotFoundException D All of these
28. An attempt to use null in a case where an object is required uses _____ Exception class.
A PrinterIOException B NullPointerException
C NumberFormatException D None of these
29. An attempt to cnvert string to a number type uses _____ Exception class.
A PrinterIOException B NullPointerException
C NumberFormatexception D None of these
30. An I/O error has occurred while printing uses _____ Exception class.
A PrinterIOException B NullPointerException
C NumberFormatException D None of these
31. The following code will result in _____ Exception
int numerator = 15; int denominator = 0; answer;
answer = numerator / denominator
A ArrayIndexOutOfBoundsException B ArithmeticException
C FileNotFoundException D All of these
32. What is the full form of JVM?
A Java Virtual Mechanism B Java Virtual Method
C Java Virtual Machine D Java Virtual Manner
33. An _____ is an error condition.
A allowance B exclusion
C error D exception
34. _____ handling is an object-oriented technique for managing errors.
A Allowance B Exclusion
C Error D Exception
35. While performing exception handling, one has to try to ensure that the program does not _____
abruptly nor does it generate unexpected output.
A terminate B finish
C dismiss D discharge
10.3 Exception handling
Here students can understand what is exception handler and how to handle the error .