public class Demo1 { public static void main(String[] args) { getMax(); } public static void getMax(){ int a=10; int b=20; if(ab){ System.out.println(a); } else{ System.out.println(b); } } }public class Demo2 { public void partaner(double m
public static void main(String[] args) {
getMax(); }
public static void getMax(){
int a=10; int b=20; if(a>b){
System.out.println(a); }
else{
System.out.println(b); }
}
}public class Demo2 {
public void partaner(double moeny,String skill){
System.out.println("我有"+moeny); System.out.println("我会"+skill); System.out.println("但是我还是没有女朋友"); }public class Demo3 {
public int[] add(int[] arrays){
for (int i = 0; i <arrays.length ; i++) {
arrays[i]*=2;
}
return arrays; }
}public class Demo4 {
public int sum(int a,int b){
int x = a+b; return x; }
}public class Demo5 {
public String dou(String douzi){
String guozhi =douzi+"豆豆浆"; return guozhi; }
}import java.util.Arrays;import java.util.Scanner;
public class Test1 {
public static void main(String[] args) {
// Demo2 demo2 = new Demo2();// demo2.partaner(200, "会撩");
// Demo3 demo3 = new Demo3();// int[] arrays={1,2,3,4,5};// int[] a=demo3.add(arrays);// System.out.println(Arrays.toString(a));
// Demo4 demo4 = new Demo4();// System.out.println("请输入第一个数:");// Scanner scanner = new Scanner(System.in);// int i =scanner.nextInt();// System.out.println("请输入第二个数:");// int i1 = scanner.nextInt();// int sum = demo4.sum(i, i1);// System.out.println((sum));
// Demo5 demo5 = new Demo5();// String zhonglei =demo5.dou("黄");// System.out.println(zhonglei); }
}