Tuesday, 29 September 2015

Java Scanner class example

import java.util.*;

public class Demoo{

public static void main(String args[])
{
 System.out.println("Enter the Employee Name ,Employee ID and Employee Salary");
 Scanner sc = new Scanner(System.in);
 String s = sc.next();
 int i = sc.nextInt();
 float j = sc.nextFloat();
 System.out.println("The employee name is "+s);
 System.out.println("The employee Employee ID is "+i);
 System.out.println("The employee Salary is "+j);
 }
}

Output:-
Enter the Employee Name ,Employee ID and Employee Salary
sai 01675 100000
The employee name is sai
The employee Employee ID is 1675
The employee Salary is 100000.0


No comments:

Post a Comment