Java Stdin and Stdout II

  • + 2 comments

    import java.util.Scanner;

    public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
         String s = scan.nextLine();
         Double d = scan.nextDouble();
         int i = scan.nextInt();
    
    
        // Write your code here.
    
        System.out.println("String: " + s);
        System.out.println("Double: " + d);
        System.out.println("Int: " + i);
    

    why this does not work? can anyone please explain, i have nextLine() before nextInt() then also String is not printed

    } }