Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is difference between call stack and stack tace?

 
shankara me
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
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.


 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
stack trace is ok, call stack is not that commonly used term

. when you call method, jvm calls stack.

when you call recursion/ method calls other method , jvm calls stack..stack... debugging it called stack trace

some other may be give you good definition .
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're more or less the same thing. If I had to make a distinction, I would consider the call stack to be the abstract idea of the current stack of methods being called, and/or the JVM's internal representation of that abstraction; and I'd consider the stack trace to be a textual representation of the call stack, for humans to use for debugging.
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great answer Jeff, that's really well put. LIKE
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool. Glad you found it useful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic