Computer Science, asked by kngowdank, 10 months ago

format to write computer programs in scanner class ​

Answers

Answered by ferisha1809
2

Answer:

The format of scanner class is a s follow:

Explanation:

//a format of scanner class

import java.util.scanner;

public class Scanner1

{

public static void main(String[] args)

{

Scanner in=new Scanner(System.in)

String str;

System.out.println("Enter a word");

str=in.next();

System.out.println("The word is:"+str);

}

}

Similar questions