Solved

Is there something like __LINE__ and __FILE__ in Java ?

Posted on 1998-07-28
1
667 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
1 Comment
 
LVL 4

Accepted Solution

by:
evijay earned 50 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now