25th Jan 2023, 10:40 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
14 Answers
+ 2
After the correction Sakshi told you to do, please write the printing statement as :- System.out.println("Enter your name " + name);
26th Jan 2023, 5:40 AM
Sanya Sanskriti
Sanya Sanskriti - avatar
+ 3
I know Sakshi already answered, but here's the mistakes in your code: 1. You need to import "java.util.Scanner" in order to use scanners (you used "input.util.java") 2. In line 10, a " . " is missing before "println" 3. Your code only outputs "enter your name" and all variables are unused
25th Jan 2023, 12:24 PM
Azka Aska
Azka Aska - avatar
+ 2
25th Jan 2023, 10:59 AM
Sakshi
Sakshi - avatar
+ 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner=new Scanner (System .in); String name; int age; float shoe; System.out.println ("enter your name"); name=scanner.nextLine(); } } This is right code now see your mistake and correct it
25th Jan 2023, 10:44 AM
Sakshi
Sakshi - avatar
+ 1
So what should I do to make it work?
25th Jan 2023, 10:50 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
0
But when you run my code it works? Cause I don't see any difference
25th Jan 2023, 10:46 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
0
Your code is not running it gives mistake in print statement and then it gives you again error in import package.
25th Jan 2023, 10:48 AM
Sakshi
Sakshi - avatar
0
I already correct your code see above and see your mistake with understand and then write
25th Jan 2023, 10:52 AM
Sakshi
Sakshi - avatar
0
It just print "enter your name"
25th Jan 2023, 10:53 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
0
Your code don't show errors but don't work either
25th Jan 2023, 11:04 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
0
Input the name, age and shoe and don't mind but please learn Java
25th Jan 2023, 11:06 AM
Sakshi
Sakshi - avatar
0
I am learning but looks like with solo learn my codes won't run
25th Jan 2023, 11:09 AM
Armando Mabunda Júnior
Armando Mabunda Júnior - avatar
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner=new Scanner (System .in); String name; int age; float shoe; System.out.println ("enter your name"); name=scanner.nextLine(); } }
27th Jan 2023, 2:15 AM
Antonio Aburto Cortez
Antonio Aburto Cortez - avatar
0
No . It will still not show you the name which you will input . For that , you need to assign the variable "name" in your printing statement. Please write:- ("enter your name " + name). You have not written "+ name"; so the value which you will assign, won't print as it is not there in the statement
27th Jan 2023, 4:08 AM
Sanya Sanskriti
Sanya Sanskriti - avatar