Do you want to print the line number of the code currently in execution in a Java program. You can use this:
System.out.println("The line number is " + new Exception().getStackTrace()[0].getLineNumber());
Comments
Cheers.