1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 class ManyMethods { 18 static class Strings { 19 public static String msg0 = "Hello World"; 20 public static String msg1 = "Hello World1"; 21 public static String msg2 = "Hello World2"; 22 public static String msg3 = "Hello World3"; 23 public static String msg4 = "Hello World4"; 24 public static String msg5 = "Hello World5"; 25 public static String msg6 = "Hello World6"; 26 public static String msg7 = "Hello World7"; 27 public static String msg8 = "Hello World8"; 28 public static String msg9 = "Hello World9"; 29 } 30 31 static class Printer { 32 static void Print(String s) { 33 System.out.println(s); 34 } 35 } 36 37 static class Printer2 { 38 static void Print(String s) { 39 System.out.println("AAA" + s); 40 } 41 } 42 43 public static void Print0() { 44 Printer.Print(Strings.msg0); 45 } 46 47 public static void Print1() { 48 Printer.Print(Strings.msg1); 49 } 50 51 public static void Print2() { 52 Printer.Print(Strings.msg2); 53 } 54 55 public static void Print3() { 56 Printer.Print(Strings.msg1); 57 } 58 59 public static void Print4() { 60 Printer.Print(Strings.msg2); 61 } 62 63 public static void Print5() { 64 Printer.Print(Strings.msg3); 65 } 66 67 public static void Print6() { 68 Printer2.Print(Strings.msg4); 69 } 70 71 public static void Print7() { 72 Printer.Print(Strings.msg5); 73 } 74 75 public static void Print8() { 76 Printer.Print(Strings.msg6); 77 } 78 79 public static void Print9() { 80 Printer2.Print(Strings.msg7); 81 } 82 83 public static void Print10() { 84 Printer2.Print(Strings.msg8); 85 } 86 87 public static void Print11() { 88 Printer.Print(Strings.msg9); 89 } 90 91 public static void main(String args[]) { 92 Print0(); 93 Print1(); 94 Print2(); 95 Print3(); 96 Print4(); 97 Print5(); 98 Print6(); 99 Print7(); 100 Print8(); 101 Print9(); 102 Print10(); 103 Print11(); 104 } 105 } 106