How to Use Division Operator in Java


In this example we will show you how to use division operator in Java.

Source Code

package com.beginner.examples;

public class DivisionOperator {
  public static void main(String[] args) {
    int a = 5;
    int b = 10;
    System.out.println(b / a); // use division operator
  }
}

Output:

2
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments