format to write computer programs in scanner class
Answers
Answered by
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
Computer Science,
6 months ago
Math,
6 months ago
English,
1 year ago
English,
1 year ago
English,
1 year ago