+ 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); } }
4 Answers
0
No it's now also saying error
+ 3
Mayukh Banerjee Java is case sensitive language...
It's
System.out.println(...) ,
Not
System.out.printLn(...)
+ 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.
+ 1
Thank you