0
Why this code takes only 1 input instead of 2 ?
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner a= new Scanner(System.in); String b= a.next(); String c = a.nextLine(); System.out.println(b); System.out.println(c); } }
5 Respostas
+ 3
Code will take 2 input,but in Sololearn you have to give all yours inputs in one prompt
+ 2
If you run your Code then a while color box will pop out! At that box you have to give input
+ 2
As Rishav said, it will appear only 1 text box(prompt) and in it you must type the two words separated by space.
0
Rishav Tiwari one prompt ??
0
Érika 👻 i got it but why do i get a space in the second output and how can i remove that ?