Você está na página 1de 4

1

try
finally

2.

1
3
5
Exception in thread "main" java.lang.NullPointerException

3.

CTE

4.

1
Exception in thread "main" java.lang.ArithmeticException: / by zero

5.

1
2
4
Exception in thread "main" java.lang.ArithmeticException: / by zero

6.

Outer Try
Inner Try
Inner Catch

7.

1
2

8.

1
Exception in thread "main" java.lang.NumberFormatException: For input string: "abc"

9.
10.
11.
12.

CTE
40
CTE
Compile & run both r success :

13.

Success
From Test

14.

Success
From Test
Error
CTE
CTS
CTS
CTE

15.
16.
17.
18.
19.

1
Exception in thread "main" java.lang.NumberFormatException: Number Format
Exception

20.

try
catch
Finally

21.
22.
23.

CTE
BDE
am I new Student of lara Technology

24.
25.
26.

CTE
CTS
java.lang

27.
28.

java.lang.Throwable
difference between Error and Exception
difference between checked exception and unchecked exception?

29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.

45.
46.
47.
48.
49.
50.
51.
52.
53.
54.

55.
56.
57.
58
59.
60.
61.
62.
63.

No
yes
no
One
No
name of 4 checked Exception
No
No
Stack Unwinding Operation
True
No
yes
jdk1.4
yes
2 types
a. Very simple:
assert<Boolean-expression>
b. smple assert:
assert<Boolean-expression> : Some-Msg
AssertionError
fixing business rules
-da or -disableassertions
c:\> java ea pack1.A

Exception in thread "main" java.lang.AssertionError


at pack1.A.main(A.java:7)
1
2
difference b/w throw & assert keyword
1
Exception in thread "main" java.lang.AssertionError:Error occured
at pack1.A.main(A.java:7)
1
2
1
Exception in thread "main" java.lang.AssertionError: 100
at pack1.H.main(H.java:7)
CTE
No(assertion error not occurred)
No
No
Yes
No
No
jdk 1.4 onwards
String s=null;

System.out.println(s.length()); // Null pointer Exception


64. String s=abc;
Int i=Integer.parseInt(s); // Number Format Exception
65. cts
Exception : ArrayIndexOutOfboundsException
66. try
Catch
Finally
Throw
Throws
67. True
68.whenever super class object keeping in subclass ClassCastException araises
Example: class A{}
class B extends A{}
class manager
{
Public static void main(String args[]){
A a1=new A();
B b1=a1;
}
}
69. NoClassDefFoundError occurs when a class was found during compilation but could not be
located in the classpath while executing the program.
For example: class A invokes method from class B and both compile fine but before executing the
program, an ANT script deleted B.class by mistake. Now on executing the program
NoClassDefFoundError is thrown.
ClassNotFoundException occurs when a class is not found while dynamically loading a class
using the class loaders.
For example: The database driver is not found when trying to load the driver using Class.forName()
method.

70. If the function is not capable of handling the exception then it can ask the calling method
to handle it by simply putting the throws clause at the function declaration.
71.most specific to most general
72.CTE
73.inorder to execute any mandatory statements
74.Difference between final & finally?
75.True
76 1. either by calling system.exit()
2. causing a fatal error that causes the process to abort
77. Exception in thread main java.lang.ArithmeticException: not valid
78. Yes by throwing same exception in catch block
79. No
80. child

Você também pode gostar