Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Java

Input and Output in Java

Print with System.out and read input with Scanner.

Input and Output in Java — a practical guide to Java Scanner System.out with clear examples you can reuse in real projects.

Java Tutorial Series (14/90). Prefer one article? Read the complete Java tutorial.

Short description

`Scanner` is a simple way to read console input while learning. Close resources in larger apps.

Scanner I/O

import java.util.Scanner;

Scanner sc = new Scanner(System.in);
System.out.print("Name: ");
String name = sc.nextLine();
System.out.println("Hello, " + name);
sc.close();

Leave a reply

Your email address will not be published. Required fields are marked *