diff options
Diffstat (limited to 'Code/Java')
-rw-r--r-- | Code/Java/Func_abc.java | 26 | ||||
-rw-r--r-- | Code/Java/Func_loop.java | 19 |
2 files changed, 45 insertions, 0 deletions
diff --git a/Code/Java/Func_abc.java b/Code/Java/Func_abc.java new file mode 100644 index 0000000..c14012e --- /dev/null +++ b/Code/Java/Func_abc.java @@ -0,0 +1,26 @@ +public class Func_abc { + public static void func_c() { + System.out.println("Function C"); + try { + Thread.currentThread().sleep(1000); + } catch (Exception e) { } + } + public static void func_b() { + System.out.println("Function B"); + try { + Thread.currentThread().sleep(1000); + } catch (Exception e) { } + func_c(); + } + public static void func_a() { + System.out.println("Function A"); + try { + Thread.currentThread().sleep(1000); + } catch (Exception e) { } + func_b(); + } + + public static void main(String[] args) { + func_a(); + } +} diff --git a/Code/Java/Func_loop.java b/Code/Java/Func_loop.java new file mode 100644 index 0000000..81be852 --- /dev/null +++ b/Code/Java/Func_loop.java @@ -0,0 +1,19 @@ +public class Func_loop { + public static void func_c() { + System.out.println("Function C"); + while (true) { + } + } + public static void func_b() { + System.out.println("Function B"); + func_c(); + } + public static void func_a() { + System.out.println("Function A"); + func_b(); + } + + public static void main(String[] args) { + func_a(); + } +} |