You are on page 1of 1

Tutorial #1

How take input from user and then show it as an output.

import java.util.*;

class InputTutorial

public static void main(String[] args)

int a;

/*declare object of Scanner Class, ee is the object that we have created of the
Scanner class, we use this object to then call methods that have already been
created within the Scanner class*\

Scanner ee = new Scanner(System.in);

System.out.print("Enter value of a : ");

/*nextInt() method of Scanner class is then called which reads the input and then we
save that input in the variable a*/

a = ee.nextInt();

// print out the value of a

System.out.println("Value of a : " +a);

You might also like