Input & Expressions – Part 1
Read numeric input with Scanner, apply arithmetic operators, and understand precedence and integer vs floating-point division.
Lesson Goals
Goals
- Read numbers with
Scanner. - Use
+ - * / %. - Understand precedence and integer vs floating division.
Scanner Setup
Scanner setup
import java.util.Scanner;
Scanner sc = new Scanner(System.in);
Use sc to read input from the keyboard in the console.
All lessons in this course
- Variables & Data Types
- Input & Expressions – Part 1
- Input & Expressions – Part 2