Well , I am currenty learning Java. But for some reason I don't know why, it's not printng String strs.
If I input
42
3.1415
Welcome to HackerRank's Java tutorials!
I get this
String:
Double: 3.1415
Int: 42
But the expected output is
String: Welcome o HackerRank's Java tutorials!
Double: 3.1415
Int: 42
Orginal code below
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
double dr= sc.nextDouble();
String strs = sc.nextLine();
System.out.println("String: " + strs);
System.out.println("Double: " + dr );
System.out.println("Int: "+ a);
}
}
about reopening ( for mods)
as I said, I am new to java and I am learing it. So i don't understand mostly of their code. They used something called option , try catch.... Still learning, so would you mind reopening the question?