Java Stdin and Stdout II

  • + 0 comments

    import java.util.Scanner;

    public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int i = scan.nextInt();  
          double d=scan.nextDouble();
         scan.nextLine();//ye next isliya dee h kyuki ye integer value le rahe tha isko khtm karne ke liya next 
                 line dee h
    

    String s=scan.nextLine();

        // Write your code here.
    
        System.out.println("String: " + s);
        System.out.println("Double: " + d);
        System.out.println("Int: " + i);
    }
    

    }