fork download
  1. import java.util.Scanner;
  2. class ScannerTest{
  3. public static void main(String args[]){
  4. Scanner sc=new Scanner(System.in);
  5.  
  6. System.out.println("Enter your rollno");
  7. int rollno=sc.nextInt();
  8. System.out.println("Enter your name");
  9. String name=sc.next();
  10. System.out.println("Enter your fee");
  11. double fee=sc.nextDouble();
  12. System.out.println("Rollno:"+rollno+" name:"+name+" fee:"+fee);
  13. sc.close();
  14. }
  15. }
Success #stdin #stdout 0.08s 4386816KB
stdin
47
allen
26598
stdout
Enter your rollno
Enter your name
Enter your fee
Rollno:47 name:allen fee:26598.0