一、eclipse操作示例
1、完整代码
import java.util.Scanner;public class inputOutput {public static void main(String[] args) {System.out.println("火影忍者,输出后自动换行");System.out.println(" ,输出8个空白字符后换行");System.out.println("\t,输出8个空白字符后换行");System.out.println("火影忍者,输出内容后\n换行");String name;String sex;String accountNumber;String password;name = "慕斯利安";sex = "男";accountNumber = "1323256999";password = "887799";System.out.print("客户的姓名是:"+name);System.out.println("\t客户的姓别是:"+sex);System.out.println("客户的账号是:"+accountNumber+"\t客户的密码是:"+password);Scanner scanner=new Scanner(System.in);String enteredData;enteredData=scanner.nextLine();System.out.println("慕斯喜欢吃的水果是:"+enteredData);}
}
2、运行效果
3、代码与运行结果关系图