Download presentation
Presentation is loading. Please wait.
Published bySiska Setiabudi Modified over 6 years ago
1
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); }
2
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); }
3
main void method2() { Console.WriteLine(“Method 2 was called”); }
Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } main 1 2 method2(); method1();
4
main void method2() { Console.WriteLine(“Method 2 was called”); }
Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } main 1 2 method2(); method1();
5
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } method2 main 1 2 method2(); method1();
6
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } method2 1 Console.WriteLine(“Method…”); main 1 2 method2(); method1();
7
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output Method 2 was called method2 1 Console.WriteLine(“Method…”); main 1 2 method2(); method1();
8
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output Method 2 was called method2 1 Console.WriteLine(“Method…”); main 1 2 method2(); method1();
9
main void method2() { Console.WriteLine(“Method 2 was called”); }
Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output Method 2 was called main 1 2 method2(); // Finished! method1();
10
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 main 1 2 method2(); // Finished! method1();
11
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 Method 1 was called main 1 2 method2(); // Finished! method1();
12
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 Method 1 was called main 1 2 method2(); // Finished! method1();
13
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } method2 Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 Method 1 was called main 1 2 method2(); // Finished! method1();
14
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } method2 1 Console.WriteLine(“Method…”); Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 Method 1 was called Method 2 was called main 1 2 method2(); // Finished! method1();
15
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } method2 1 Console.WriteLine(“Method…”); Output 1 2 3 Console.WriteLine(“Method…”); method2(); Method 2 was called method1 Method 1 was called Method 2 was called main 1 2 method2(); // Finished! method1();
16
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); // Finished! Method 2 was called method1 Method 1 was called Method 2 was called main 1 2 method2(); // Finished! method1();
17
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); // Finished! Method 2 was called method1 Method 1 was called Method 2 was called Method 1 still alive main 1 2 method2(); // Finished! method1();
18
void method2() { Console.WriteLine(“Method 2 was called”);
} void method1() { Console.WriteLine(“Method 1 was called”); method2(); Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output 1 2 3 Console.WriteLine(“Method…”); method2(); // Finished! Method 2 was called method1 Method 1 was called Method 2 was called Method 1 still alive main 1 2 method2(); // Finished! method1();
19
main void method2() { Console.WriteLine(“Method 2 was called”); }
Console.WriteLine(“Method 1 still alive”); } void main() { method1(); } Output Method 2 was called Method 1 was called Method 2 was called Method 1 still alive main 1 2 method2(); // Finished! method1(); // Finished!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.