in IDEA the result is "2". it seems to be true.
in codegym the result is "11". Why 11? Where is 11 methods in code?
package com.codegym.task.task09.task0905;
/*
In the blue depths of the stack trace…
*/
public class Solution {
public static void main(String[] args) throws Exception {
int deep = getStackTraceDepth();
}
public static int getStackTraceDepth() {
// write your code here
System.out.println(Thread.currentThread().getStackTrace().length-1);
return (Thread.currentThread().getStackTrace().length-1);
}
}