Solved

Is there something like __LINE__ and __FILE__ in Java ?

Posted on 1998-07-28
1
725 Views
Last Modified: 2012-06-21
Is there anything in JAVA that is comparable to the __LINE__ and __FILE__ from C/C++ ?
thanks in advance!
0
Comment
Question by:jefftk99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
evijay earned 50 total points
ID: 1228771
You have to write a function which does the following -


Exception e = new Exception("dummy");
e.printStackTrace( a_print_stream);

here, a_print_stream is a PrintStream generated from a array of bytes or a custom print stream. The stack trace is sent to the print stream which you have to convert to chars, then, parse the function to get to the appropriate calling function details and print them

0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question