Ad

return the bigger number between the two parameters.
if numbers are equal return anyone on them.

Code
Diff
  • public class BiggerNum{
    
      public static int compare(int a, int b) {
        if(a > b){
          return a;
        }else if(a < b){
          return b;
        }else return a;
      }
    
    }
    • public class BiggerNum{
    • public static int compare(int a, int b) {
    • return 0;
    • if(a > b){
    • return a;
    • }else if(a < b){
    • return b;
    • }else return a;
    • }
    • }