How to use Scanner Class(And Take a input from Scanner) - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
How to use Scanner Class(And Take a input from Scanner)

How to use Scanner Class(And Take a input from Scanner)

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);
   
}
}

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.