Questions tagged as 'java-util-scanner'

3
answers

Problem when using Scanner # nextLine (); inside a for

The question is that I want to enter a String that can contain space (ex: United States) and for that reason I use the nextLine, but also in that same method I enter data type Int. The problem is that being inside a for in the second entry, it g...
asked by 20.01.2016 / 02:32
2
answers

Problem with Java scanner

Good morning, I'm doing a small project to work with hospital patients. My problem arises when I want to receive data by keyboard. What code do I have? _ //Get nombre System.out.println("Introduzca nombre del paciente");...
asked by 31.03.2017 / 20:32
1
answer

Problem with Java switch

I have a menu with a switch with 3 options that does the following: Data Capture Data query Finish In option 1 the user is requested all the necessary data. In option 2 I want to show this data that was saved. The question is, how...
asked by 04.03.2018 / 23:40
1
answer

Possible restriction in Eclipse? with Java [duplicated]

I have in my code several System.out.println () asking certain things and picking up in their corresponding variable what the user enters through the keyboard. The fact is that after several System.out.println (), Eclipse is as if you ignored...
asked by 03.09.2017 / 02:56
1
answer

Add object to an ArrayList using the Scanner

I have the following code in my main: if (opt1>0){ switch (opt1){ case 1: System.out.println("New customer"); Customer.addCustomer(); customerList.add(new Customer(getNa...
asked by 21.02.2017 / 20:42
3
answers

Problem when using Scanner # nextLine (); inside a for

The question is that I want to enter a String that can contain space (ex: United States) and for that reason I use the nextLine, but also in that same method I enter data type Int. The problem is that being inside a for in the second entry, it g...
asked by 20.01.2016 / 02:32
6
answers

Problem Scanner class in Java when entering multiple Strings as variables [duplicate]

I'm doing a little program for something more complex than this one, but the main problem I have is that I need to add at least two names but when I run it skips entering the first name. Better explain me in code, this is a small example of wh...
asked by 01.12.2017 / 00:49
2
answers

Doubt Scanner class in Java

I have this little code. It happens that when the time comes to enter the third data (the name), it jumps, it is as if it were automatically given to enter and could not write anything: Scanner sc = new Scanner(System.in); Syst...
asked by 28.05.2018 / 22:11
2
answers

How to display several options within a menu in cosola in java?

My question is how to make a kind of menu within another menu. For example, I display in my code 4 options to choose from, in one of them if it is chosen it would be necessary to also display several options to choose from. It would be like a ne...
asked by 26.10.2017 / 03:29
1
answer

error when entering data by console using the Scanner class [duplicated]

I'm new in java I was practicing conditional and I wanted to do it more interactive but I have a problem and I think it has to do with the Scanner class it happens that the second time that he asks to enter the name and the score shows it in a...
asked by 01.11.2017 / 07:27