java 循环中参数怎么传递
packagecom.BankXt;importjava.util.Scanner;publicclasspassword{publicvoidpasswordDuibi...
package com.BankXt;
import java.util.Scanner;
public class password {
public void passwordDuibi()
{
while(true){
System.out.print("请输入6位密码:");
Scanner ps1 = new Scanner(System.in);
String psOne = ps1.nextLine();//等待用户输入""
if (psOne.length()==6)
break;
else
{ System.out.println("警告:输入错误请从新输入!!!");continue;}}
while(true){
System.out.print("请确认密码:");
Scanner ps2 = new Scanner(System.in);
String psTwo = ps2.nextLine();//等待用户输入""
if (psTwo.length()==6)
break;
else
{ System.out.println("警告:输入错误请从新输入!!!");continue;}}
passwordHedui PsHedui=new passwordHedui(psOne,psTwo) 展开
import java.util.Scanner;
public class password {
public void passwordDuibi()
{
while(true){
System.out.print("请输入6位密码:");
Scanner ps1 = new Scanner(System.in);
String psOne = ps1.nextLine();//等待用户输入""
if (psOne.length()==6)
break;
else
{ System.out.println("警告:输入错误请从新输入!!!");continue;}}
while(true){
System.out.print("请确认密码:");
Scanner ps2 = new Scanner(System.in);
String psTwo = ps2.nextLine();//等待用户输入""
if (psTwo.length()==6)
break;
else
{ System.out.println("警告:输入错误请从新输入!!!");continue;}}
passwordHedui PsHedui=new passwordHedui(psOne,psTwo) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询