Puneet Chadha

Greenhorn
+ Follow
since Oct 03, 2011
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Puneet Chadha

Not quite clear guys
what class is 'T' determined as in the call of option A. ?
I ran the code
and got the following output


fin
Exception in thread "main" java.lang.Throwable
at battery.Battery.main(Battery.java:14)
Java Result: 1


which is expected as the code is throwing an object of Throwable Class and trying to catch it with an Exception object in the argument of catch block.The Throwable object is not caught as shown in the output.finally will always be run unless System.out.exit() is called.
2 objects will be eligible for garbage collection
the one originally reference by d or da[1] & the other one being the int array reference d.dz or da[1].dz