Advertisement
zachgordon25

MethodCalls

Nov 17th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package week11.solutions;
  2.  
  3. public class MethodCalls {
  4.     public static void main(String[] args) {
  5.         method1();
  6.     }
  7.  
  8.     public static void method1() {
  9.         System.out.println(1);
  10.         method2();
  11.         method3();
  12.         System.out.println("Finished");
  13.     }
  14.  
  15.     public static void method2() {
  16.         System.out.println(2);
  17.         method4();
  18.         method6();
  19.     }
  20.  
  21.     public static void method3() {
  22.         System.out.println(3);
  23.         method5();
  24.     }
  25.  
  26.     public static void method4() {
  27.         System.out.println(4);
  28.     }
  29.  
  30.     public static void method5() {
  31.         System.out.println(5);
  32.     }
  33.  
  34.     public static void method6() {
  35.         System.out.println(6);
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement