You are on page 1of 1

3 steps:

--------
1. import the Scanner class.
2. create an object for Scanner class.
3. use the scanner object to invoke the appropriate methods.

import java.util.Scanner;

class MyClass{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int num=input.nextInt();
float money=input.nextFloat();
double amount=input.nextDouble();
String word=input.next();
String sentence=input.nextLine();

You might also like