get Current runnable code Line Number - Java java.lang

Java examples for java.lang:Throwable

Description

get Current runnable code Line Number

Demo Code


//package com.java2s;

public class Main {
    public static int getLineNumber() {
        return Thread.currentThread().getStackTrace()[2].getLineNumber();
    }//from   w w  w. ja v a 2  s  . co  m
}

Related Tutorials