• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stack Trace

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Run away! Run away! Here, take this tiny ad with you:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic