You are here:

Java/exception handling

Advertisement


Question
Hi sir!
My doubt is on call stack and stack trace in java.
Call stack: “The call stack is an internal list of all the methods that are currently executing.”
Stack trace: ”It is a list of all all the methods in call stack.”
According to above definitions Stacktrace contains list of all the methods in call stack.
Then what is the difference between call stack and stack trace?
Please explain the difference.

Answer
A call stack also includes all local variables at each method along with the location in each method and is used while the program is running.

A stack trace is only methods and their location (not variables). The stack trace is generated from the call stack and is used for diagnosis purposes.

Java

All Answers


Answers by Expert:


Ask Experts

Volunteer


Artemus Harper

Expertise

I have a Masters in computer science. I can answer questions on core J2SE, swing and graphics. Please no questions about JSP or J2ME.

Experience

I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection. Some experience in bio-informatics. Basics in c++ and c#

Organizations
Washington State University

Education/Credentials
MS in Computer Science from Washington State University and a BS in Mathematics and Computer Science from Central Washington University.

©2016 About.com. All rights reserved.