Зачем нужен return в 37 строке кода ?
package com.javarush.task.task09.task0903;
/*
Кто меня вызывал?
*/
public class Solution {
public static void main(String[] args) {
method1();
}
public static int method1() {
method2();
return method2();
}
public static int method2() {
method3();
return method3();
}
public static int method3() {
method4();
return method4();
}
public static int method4() {
method5();
return method5();
}
public static int method5() {
StackTraceElement [] stackTraceElement = Thread.currentThread().getStackTrace();
for(StackTraceElement element : stackTraceElement)
return element.getLineNumber();
}
}