Most asked top Interview Questions and Answers | Online Test | Mock Test
Education platform for interview prep, online tests, tutorials, and live practice

Build skills with focused learning paths, mock tests, and interview-ready content.

WithoutBook brings subject-wise interview questions, online practice tests, tutorials, and comparison guides into one responsive learning workspace.

Search the library
Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

WithoutBook Forum

Ques. try catch finally printstacktrace in Eclipse

- Suppose system.out.println is writted in try, catch and finally all blocks. And e.printStackTrace is writted in catch block.
try{
System.out.println(\"Try\");
int i=1/0;
}
catch(Exception e){
System.out.println(\"Catch\");
e.printStackTrace();
}
finally{
System.out.println(\"Finally\");
}

For this program I\'ve seen printStackTrace error comes anywhere. It maybe just after Try, May be just after Catch or may be just after Finally; which should be only after Catch.
Why this is happening please let me know.

Posted on Jul 18, 2014 by Pom Berry

Enter your Answer

Name
Email Address
Answer
Security Check
Solve this to continue: 4 + 4 = ?
©2026 WithoutBook