Language syntax

Integer division operator /

For integral operands after promotion, returns the quotient with the fractional part discarded toward zero. A zero divisor throws ArithmeticException; minimum signed value divided by -1 wraps.

Formal Syntax & Structure

java syntaxjava
left / right

Working Example

Example Snippetjava
public class Main {    public static void main(String[] args) {        System.out.println(23 / 5);        System.out.println(-23 / 5);    }}
Java Reference