import java.util.Scanner;public class scduixiang {String account = "zsl";String password = "123456";public void accountInfo() {System.out.println("账号" + account + "\t密码:" + password);}public static void main(String[]args){scduixiang admin =new scduixiang();System.out.println("未修改之前的密码");admin.accountInfo();Scanner sc=new Scanner(System.in);while(true){System.out.print("请输入账号名称");String name=sc.next();System.out.println("请输入密码");String pwd=sc.next();if(name.equals(admin.account)&&pwd.equals(admin.password)){System.out.println("请输入修改后的密吗");pwd=sc.next();admin.password=pwd;break;}else {System.out.println("你输入的密码有误,请重新输入");}}System.out.println("新密码是:");admin.accountInfo();}}