Sorry can someone see what's up? commenting out thread.join() doesn't help, I just added it for clarity of execution.
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();
thread.join();
System.out.println("*****************");
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
System.out.println(element);
}
}
public static class SpecialThread implements Runnable
{
public void run()
{
System.out.println(Thread.currentThread().getStackTrace());
}
}
}