String uname = reason; int pwd = 123456; Scanner input = new ScannerSystemin; Systemoutprintln请输入用户名和密码:; String str = inputnext; int password = inputnextInt; ifstr==uname&&password==pwd
根据给出的代码,如果用户名一直报错,可能是因为输入的用户名和预设的用户名不一致。在代码中,预设的用户名是"reason",所以输入的用户名必须完全匹配才能通过验证。请确保输入的用户名与预设的用户名完全相同。
原文地址: http://www.cveoy.top/t/topic/hAfg 著作权归作者所有。请勿转载和采集!