+ 2

Please help me out to fix the following error occured in Java program. Details of it are mentioned in description.

Error: The constructor Scanner(InputStream) is undefined The method nextline() is undefined for the type Scanner at Scanner.main(Scanner.java:5)

17th Jul 2018, 2:49 PM
Aprameya Gupta
Aprameya Gupta - avatar
6 Antworten
+ 7
change class Scanner to something else
17th Jul 2018, 3:25 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
try nextLine()
17th Jul 2018, 3:11 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 4
code?
17th Jul 2018, 3:17 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 2
Still not working
17th Jul 2018, 3:16 PM
Aprameya Gupta
Aprameya Gupta - avatar
+ 2
import java.util.Scanner; class Scanner { public static void main(String args[]) { Scanner peaches = new Scanner(System.in); System.out.println(peaches.nextLine()); } }
17th Jul 2018, 3:23 PM
Aprameya Gupta
Aprameya Gupta - avatar
+ 2
yehh, I changed it just now only. The moment ur message popped up. Well thanx for ur help.
17th Jul 2018, 3:27 PM
Aprameya Gupta
Aprameya Gupta - avatar