• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I trace method calls?  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the two simple Java classes below:





After the program run, how do I trace (1) which object call which method (2) and how many times?

Thanks for any suggestion.
 
Marshal
Posts: 56608
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

No.

The idea is that a method responds to its caller, and the called method does not care or know where it is called from.
You can trace how many times a method is called with a counter field, but you cannot tell where it was called from.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!