Nishita
thanks,<br />gaurav abbi
Originally posted by Nishita Jain:
But I want to print StackTrace in finally block without using catch block . can anyone guide me about this?
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Nishita
Originally posted by Nishita Jain:
so what if we remove catch block? can we access that stack in finally without using catch?
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Nishita
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan Muthu:
Thats right. But in your example, you dont throw an exception. In such case, why anyone would really want to have the code surrounded by try block?
Originally posted by Nishita Jain:
So what if we remove catch block? can we access that stack in finally without using catch?
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Don Morgan, Founder
www.DeveloperAdvantage.com - FREE Audiobooks for Software Developers
thanks,<br />gaurav abbi
Thread.currentThread().dumpStack();
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Creating an exception and printing a stack trace doesn't sounds right.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I also agree that trick questions like this are not very useful. It might be fun to see how interviewees respond to the pressure, but I'd probably respond by rolling my eyes and checking my watch.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |