Hi!
I tried some methods for getting the stack, but I can't get it, anyone got a hint?
Thanks
package com.codegym.task.task16.task1604;
/*
Displaying a stack trace
*/
public class Solution {
public static void main(String[] args) throws InterruptedException {
Thread thread = new Thread(new SpecialThread());
thread.start();
System.out.println("*****************");
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
System.out.println(element);
}
}
public static class SpecialThread implements Runnable {
public void run(){
Thread.dumpStack();
}
}
}