Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Stack-traces/Java/stack-traces-1.java
Normal file
11
Task/Stack-traces/Java/stack-traces-1.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
public class StackTracer {
|
||||
public static void printStackTrace() {
|
||||
StackTraceElement[] elems = Thread.currentThread().getStackTrace();
|
||||
|
||||
System.out.println("Stack trace:");
|
||||
for (int i = elems.length-1, j = 2 ; i >= 3 ; i--, j+=2) {
|
||||
System.out.printf("%" + j + "s%s.%s%n", "",
|
||||
elems[i].getClassName(), elems[i].getMethodName());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue