Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to write a mult in AIDE in java, define two integer parameters and return their product?
How to write a mult in AIDE in java, define two integer parameters and return their product?
I guess the mult you said should be a method name. It defines two integer parameters, and you can use * to return the product. Look at the code below.

Public? Class? test

{

Public? Static electricity int? mult(int? First,? int? b)

{

Return? Answer? *? b;

}

Public? Static electricity Invalid? main(String[]? Parameter)

{

int? Answer? =? 1,? b? =? 2;

int? The result? =? mult(a,b);

System.out.println (result); ? //? Output? 2

}

} I hope I can help you, and I hope to adopt it ~