File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stack Trace

 
Natraj Gudla
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When i capture an exception and print a stack trace, it prints even the line in the function where it was thrown.Does this line number show the actuall number in the source file or in the compile file(that is the byte code).
as i am unable to relate to the line number in the trace and the same in the source file.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the line number in the source file. You may be seeing some of the core API library source file line numbers. If you will post the stack trace and indicate the line that is confusing you maybe we can figure it out.
 
Gayathri Prasad
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Nataraj,
1-public class Test1
2-{
3-public static void main(String args[])
4-{
5- int a[]=new int[5];
6- System.out.println(a[6]);
7-}
8-};

F:\Programs\Java\General>java Test1
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at Test1.main(Test1.java:6)
So as the above example says there was a problem at line 6 and thus the line number is the linbe # of Source file.
Cheers,
Gaya3
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic