+ 2

Can anyone say what is the problem with the code. Why it is saying error after running

import java.util.Scanner; class MyScanner { public static void main(String[] args) { String str; int a; float b; Scanner print = new Scanner(System.in); System.out.printLn("Enter String "); str = print.nextLine(); System.out.prinLn("String " + str); System.out.printLn("Enter Integer "); a = print.nextInt(); System.out.printLn("Integer "+ a); System.out.printLn("Enter Float"); b = print.nextFloat(); System.out.printLn("Float " + b); } }

3rd Oct 2021, 1:11 PM
Mayukh Banerjee
Mayukh Banerjee - avatar
4 ответов
0
No it's now also saying error
3rd Oct 2021, 1:43 PM
Mayukh Banerjee
Mayukh Banerjee - avatar
+ 3
Mayukh Banerjee Java is case sensitive language... It's System.out.println(...) , Not System.out.printLn(...)
3rd Oct 2021, 1:18 PM
Rupali Haldiya
Rupali Haldiya - avatar
+ 3
Mayukh Banerjee , check the spelling of your code carefully. there is one line that is: System.out.prinLn("String " + str); there is also a 't' missing.
3rd Oct 2021, 2:18 PM
Lothar
Lothar - avatar
+ 1
Thank you
3rd Oct 2021, 2:26 PM
Mayukh Banerjee
Mayukh Banerjee - avatar