+ 1

Why always user input 🥹 //import

Import

25th Jul 2025, 2:30 AM
Sen Busaye
Sen Busaye - avatar
9 Risposte
+ 2
If you ask you question more clearly it will be more likely someone will be able to help you.
25th Jul 2025, 2:59 AM
Zvi
Zvi - avatar
+ 3
Sen Busaye , let me do a guess. are you talking about the *import* statement for the scanner class in java ? like this: import java.util.Scanner; // <= ??? public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); int fruit = input.nextInt(); ...
25th Jul 2025, 10:28 AM
Lothar
Lothar - avatar
+ 1
Sorry i still understand your question. Do you want to know why the user input woukd be asked from the user? Obviously to get his info. If you have difficulty explaining your question in english you can write it fully in google tranlate and copy it here. It might be easier to express yourself more completely that way.
25th Jul 2025, 3:11 AM
Zvi
Zvi - avatar
+ 1
Without the import you have to write: java.util.Scanner input = new java.util.Scanner( System.in); instead of : import java.util.Scanner; .. Scanner input = new Scanner(System.in); Once you import the Scanner class from the java.util package (originally in the java directory and the util subdirectory), you can use it with shorter notation, because the compiler then knows where this class is physically stored.
28th Jul 2025, 3:55 PM
zemiak
0
I meant user input
25th Jul 2025, 3:01 AM
Sen Busaye
Sen Busaye - avatar
0
I knew how to code it but sometimes it gives me a headache
25th Jul 2025, 3:47 AM
Sen Busaye
Sen Busaye - avatar
0
You are using Java. Java gives everyone a headache
25th Jul 2025, 5:55 AM
Aleksei Radchenkov
Aleksei Radchenkov - avatar
0
Yes sir
27th Jul 2025, 1:05 AM
Sen Busaye
Sen Busaye - avatar
0
Thanks with a short tutorial
3rd Aug 2025, 7:04 AM
Sen Busaye
Sen Busaye - avatar