Im etwas im Fall 1 in dem Schalter zu setzen versuchen, dass, wenn ich fügen Sie den neuen PIN-Code wird „*“ eher als die tatsächliche AnzahlErstellen von versteckten Zeichen in Java-Anwendungen
import java.util.Scanner;
public class Main {
public Main() {
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int userChoice;
boolean quit = false;
System.out.println("Welcome to GNBanking");
System.out.println("Please Create Your Account");
String name;
String add;
int contact;
double initialdep;
int pin;
int random = (int)(Math.random() * 999999 + 1);
Scanner reg = new Scanner (System.in);
System.out.println("Please Fill out the information below");
System.out.println("Enter Your Name: ");
name = reg.nextLine();
System.out.println("Enter Your Address: ");
add = reg.nextLine();
System.out.println("Enter Your Contact Number: ");
contact = reg.nextInt();
System.out.println("Enter Your Initial Deposit");
initialdep = reg.nextInt();
System.out.println("Enter Your Pin: ");
pin = reg.nextInt();
System.out.println("Congratulations You Are Now A Member Of GNBanking Please Confirm Your Account");
System.out.println("Name of Member: " +name);
System.out.println("Address: "+ add);
System.out.println("Contact Number:" +contact);
System.out.println("Initial Deposit: "+initialdep);
System.out.println("Pin " + pin);
System.out.println("Is the Information Accurate? Y/N ");
String choice =reg.next();
if(choice.equalsIgnoreCase("Y")){
System.out.println("Excellent!!");
System.out.println("Your Account Number is: "+ random);
System.out.println("Name of Member: " +name);
System.out.println("Address: "+ add);
System.out.println("Contact Number:" +contact);
System.out.println("Initial Deposit: "+initialdep);
System.out.println("Pin: " + pin);
}else if(choice.equalsIgnoreCase("N")){
System.out.println("Do You Want to try again? Y/N");
String secchoi = reg.next();
if(secchoi.equalsIgnoreCase("Y")){
main (null);
}else if (secchoi.equalsIgnoreCase("N")){
System.out.println("Have A Nice Day!");
}
}
do {
System.out.println("[1] Change Pincode");
System.out.println("[2] View Balance");
System.out.println("[3] Deposit Money");
System.out.println("[4] Withdraw ");
System.out.println("[5] Close Account");
userChoice = in.nextInt();
switch (userChoice) {
case 1:
// Here Im trying to create a change pin that wont show the int but rather the character "*" when I type
break;
case 2:
// View Balance
break;
case 3:
// Deposit
break;
case 4:
// Withdraw
break;
case 5:
quit = true;
break;
default:
System.out.println("Wrong choice.");
break;
}
System.out.println();
} while (!quit);
System.out.println("Have A Nice Day");
}
}
*/
Warum haben Sie JavaScript markiert? –