Question
Write a method in Java that takes two parameters. If the first parameter is equal to the second parameter multiply both and print the result.
Thanks.
Thanks.
Answers
Steve
There are lots of java snippets online. Here's something that should work:
public static void xx(int n1, int n2) {
if (n1 == n2) System.out.println(n1*n2);
}
It can be prettied up some, but that's basically all you need.
public static void xx(int n1, int n2) {
if (n1 == n2) System.out.println(n1*n2);
}
It can be prettied up some, but that's basically all you need.