Is there a way to obtain the line number in my code? For example:
1 public class MyClass {
2 int a = 5;
3 System.out.prin tln("Integer variable a was set on line number: " + x);
4 etc.
Where x is equal to '2'.
How can I obtain 'x' ?
Thanks.
1 public class MyClass {
2 int a = 5;
3 System.out.prin tln("Integer variable a was set on line number: " + x);
4 etc.
Where x is equal to '2'.
How can I obtain 'x' ?
Thanks.
Comment