Jump to content

Algorithms/Find maximum/Java findMax method 6

From Wikibooks, open books for an open world
private int findMaxFourEle(int i_intA,int i_intB,int i_intC, int i_intD) {
     int max = i_intA;
     if ( i_intB > max ) max = i_intB;
     if ( i_intC > max ) max = i_intC;
     if ( i_intD > max ) max = i_intD;     
     return max;
  } // end method

  public int findMaxThreeEle(int i_intA,int i_intB,int i_intC) {
     return findMaxFourEle(i_intA,i_intB,i_intC,i_intC);
  } // end method