Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8917107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:24:27+00:00 2026-06-15T05:24:27+00:00

My prompt Please Enter your ID just after the second for loop is not

  • 0

My prompt “Please Enter your ID” just after the second for loop is not appearing, it goes straight to “Please enter your password.” It also skips alot of code from the Login Prompt to the Password prompt. If you have any ideas as to why it behaves like this please share it with me thanks.

public void main(String[] args){

    Accounts Accounts = new Accounts();

    Scanner kb = new Scanner(System.in);

    System.out.print("Please create a login ID and hit \"ENTER\": ");
    Login = kb.nextLine();

    for(;;){
        if(!Accounts.isTaken(Login)){
            System.out.print("Please create a password and hit \"ENTER\": ");
            PW = kb.nextLine();
            if(Accounts.validPW(PW)){
                Accounts.createAccount(Login, PW);
                break;
            }
        }
    }

    System.out.print("Do you wish to Log in ? (Y/N): ");
    String response = kb.nextLine();
    if((response=="y")||(response=="Y")){
        for(;;){
           //Not Being Shown
            System.out.println("Please enter your ID: "); // ?????? Where are you?????
            Login = kb.nextLine();
            Accounts.login(Login);
            //Goes straight here
            System.out.print("Please enter your Password: ");
            if ((Accounts.isValid(Login))&&(Accounts.checkAuth(kb.nextLine()))){
                break;
            }
            else{
                System.out.println("Invalid Login-Password!");
            }
        }
    }
    System.out.println("Please enter your Password: ");
    System.out.println("LOGIN AUTHORIZED: "+Accounts.checkAuth(kb.nextLine()));
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:24:29+00:00Added an answer on June 15, 2026 at 5:24 am

    Instead of

    (response=="y")||(response=="Y")
    

    use

    (response.equals("y"))||(response.equals("Y"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple function function Login() { var x=prompt(Please enter your name,); var
function show_prompt() { var name=prompt(Please enter your name); } I am calling this function
I cannot find where the sqlcmd is? i just want the prompt. please help!
Firstly, here is my code: Ext.Msg.show({ title: 'Username', msg: 'Please enter your username', buttons:
while(1){ //Command prompt char *command; printf(%s>,current_working_directory); scanf(%s,command);<--seg faults after input has been received. printf(\ncommand:%s\n,command);
When we use Javascript prompt Box something like this var ur_name = prompt(Enter Name);
This is a program that is supposed to prompt the user to enter three
After I installed PostgreSQL 9.1 on Ubuntu 12.04 I set the password for the
I am using simple extjs prompt for getting one value from user Ext.Msg.prompt('Name', 'Please
I prompt the user if they want to order fish, once they are done

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.