How to return the result of an expression that multiplies two values from a function in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            int n = mul(13, 7);
            System.out.println(n);

        } catch (Exception e) {
            System.out.print(e.toString());
        }
    }
    static int mul(int a, int b) {
        return a * b;
    }
}

/*
              
run:
 
91
     
 */

 



answered Dec 4, 2016 by avibootz

Related questions

...