membagi angka menggunakan metode


public class Sample {
    public static void main(String[] args) {
        float result = divide(30, 5);
        System.out.println(result);
    }

    // method to calculate
    static int divide(int num1, int num2) {
        return num1 / num2;
    }
}
Fernandez, Jasmine M.