public class ZhaZhiJi{//榨汁机的类代码
public String zhaZhi(String shuiGuo){
return shuiGuo+"汁";
}
}
import java.util.Scanner;
public class TestZhaZhi{//调用代码
public static void main(String[] args){
ZhaZhiJi ji1=new ZhaZhiJi();
System.out.println("请给水果:");
Scanner input=new Scanner(System.in);
String shuiGuo=input.next();
String zhi=ji1.zhaZhi(shuiGuo);
System.out.println(zhi);
}
}
public String zhaZhi(String shuiGuo){
return shuiGuo+"汁";
}
}
import java.util.Scanner;
public class TestZhaZhi{//调用代码
public static void main(String[] args){
ZhaZhiJi ji1=new ZhaZhiJi();
System.out.println("请给水果:");
Scanner input=new Scanner(System.in);
String shuiGuo=input.next();
String zhi=ji1.zhaZhi(shuiGuo);
System.out.println(zhi);
}
}