+ 2
Whenever I try to take input a string using scanner class program is compiled but execution is not done why???
8 Answers
+ 24
hey buddy , execution is done but u can't see it ,
//for seeing that its executed , u can print what u have taken as input
String input = sc.nextLine ();
System.out.print(input);
//hope it helps âș
+ 24
import java.util.*;
class Inp
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
System.out.println(s);
}
}
//sorry ,i noticed just now
//hope it helps âș
+ 23
can u show the code by making it public
+ 3
Is it ryt??
+ 2
I printed but it's execution is in process not printed
+ 2
import java.util.*;
class Inp
{
public static void main()
{
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
System.out.println(s);
}
}
+ 2
Thank you sir
+ 1
Sir I wanted to ask a program like I'm declaring one int type array say marks n one String type array say name I want to prepare a merit list in descending order of marks n print the marks along with the name. Sorting I know but don't know if it is possible then plz suggest me