I don't know what's the purpose of doing it, but when you compile your java code you can enable debug so that when exception thrown it will tell you at which line you have problem.
Do you know why this cup is useful? Because it is empty.
StackTraceElement[] st = Thread.currentThread().getStackTrace(); int lineNumber = st[st.length-1].getLineNumber(); System.out.println("lineNumber "+lineNumber);
StackTraceElement[] st = Thread.currentThread().getStackTrace(); int lineNumber = st[st.length-1].getLineNumber(); System.out.println("lineNumber "+lineNumber);
Nice one man. This should work. Really nice thought. It never striked my mind.
Regards,
Durga Prasad
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.