0

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sourav = new Scanne

this code is taking the input but not giving output. why?

25th Jul 2017, 8:41 AM
Sourav Kumar
Sourav Kumar - avatar
13 Réponses
+ 1
Could it be that you cut something off?
25th Jul 2017, 8:59 AM
Jonas Schröter
Jonas Schröter - avatar
+ 1
In this code, you only create a new scanner instance
25th Jul 2017, 9:05 AM
Jonas Schröter
Jonas Schröter - avatar
+ 1
Glad I could help😊
25th Jul 2017, 9:38 AM
Jonas Schröter
Jonas Schröter - avatar
0
like?
25th Jul 2017, 9:03 AM
Sourav Kumar
Sourav Kumar - avatar
0
also when trying to run any program on eclipse a message pops out saying the selection cannot be launched and there are no recent launches. plss help me out
25th Jul 2017, 9:21 AM
Sourav Kumar
Sourav Kumar - avatar
0
can you show your whole code please?
25th Jul 2017, 9:23 AM
Jonas Schröter
Jonas Schröter - avatar
0
what is a while code? I'm new to java.
25th Jul 2017, 9:24 AM
Sourav Kumar
Sourav Kumar - avatar
0
whole
25th Jul 2017, 9:24 AM
Jonas Schröter
Jonas Schröter - avatar
0
import java.util.Scanner ; public class Program { public static void main(String[] args) { scanner tuna = new Scanner (System.in); System.out.println(tuna.nextline()) ; } }
25th Jul 2017, 9:31 AM
Sourav Kumar
Sourav Kumar - avatar
0
It's Scanner tuna, not scanner tuna.
25th Jul 2017, 9:32 AM
Jonas Schröter
Jonas Schröter - avatar
0
And it's nextLine ()
25th Jul 2017, 9:33 AM
Jonas Schröter
Jonas Schröter - avatar
25th Jul 2017, 9:34 AM
Jonas Schröter
Jonas Schröter - avatar
0
hey thanks a lot... didn't know block letter matter that much. 😅
25th Jul 2017, 9:38 AM
Sourav Kumar
Sourav Kumar - avatar