- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
public class Main {
public static void main(String[] args) {
f0();//this is call of f0() from line 4
f0();//this is call of f0() from line 4
}
public static void f0(){
System.out.println("hi, I am f0");
Exception e = new Exception();
if(e.getStackTrace()[1].getLineNumber()==3){
f1();
} else if(e.getStackTrace()[1].getLineNumber()==4){
f2();
}
}
public static void f1(){
System.out.println("hi, I am f1");
}
public static void f2(){
System.out.println("hi, I am f2");
}
}