import java.util.*;
class ScannerUse
{
public static void main(String[]arr)
{
String s ="hello . DreamTech";
/// crating object and pass some values
Scanner sc=new Scanner(s);
//
System.out.println("---------Enter your details--------");
Scanner in= new Scanner(System.in);
System.out.println("Enter your name:");
String name=in.next();
System.out.println("name"+name);
System.out.println("Enter your age");
int i=in.nextInt();
System.out.println("Age"+i);
System.out.println("Enter your salary");
double d=in.nextDouble();
System.out.println("Salary"+d);
}
}
class ScannerUse
{
public static void main(String[]arr)
{
String s ="hello . DreamTech";
/// crating object and pass some values
Scanner sc=new Scanner(s);
//
System.out.println("---------Enter your details--------");
Scanner in= new Scanner(System.in);
System.out.println("Enter your name:");
String name=in.next();
System.out.println("name"+name);
System.out.println("Enter your age");
int i=in.nextInt();
System.out.println("Age"+i);
System.out.println("Enter your salary");
double d=in.nextDouble();
System.out.println("Salary"+d);
}
}
0 comments:
Post a Comment