package com.codegym.task.task09.task0904;
/*
Stack trace with 10 calls
*/
public class Solution {
public static void main(String[] args) throws Exception {
int stackTraceLength = method1().length - method10().length + 1;
method1();
}
public static StackTraceElement[] method1() {
method2();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method2() {
//write your code here
method3();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method3() {
//write your code here
method4();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method4() {
//write your code here
method5();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method5() {
//write your code here
method6();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method6() {
//write your code here
method7();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method7() {
//write your code here
method8();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method8() {
//write your code here
method9();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method9() {
method10();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method10() {
return Thread.currentThread().getStackTrace();
}
}
package com.codegym.task.task09.task0904;
/*
Stack trace with 10 calls
*/
public class Solution {
public static void main(String[] args) throws Exception {
int stackTraceLength = method1().length - method10().length + 1;
method1();
}
public static StackTraceElement[] method1() {
method2();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method2() {
//write your code here
method3();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method3() {
//write your code here
method4();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method4() {
//write your code here
method5();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method5() {
//write your code here
method6();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method6() {
//write your code here
method7();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method7() {
//write your code here
method8();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method8() {
//write your code here
method9();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method9() {
method10();
return Thread.currentThread().getStackTrace();
}
public static StackTraceElement[] method10() {
return Thread.currentThread().getStackTrace();
}
}