Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Algorithms/Find maximum/Java findMax method 1

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Code Java public int findMax(final int[] i_intaryTab) { if ( i_intaryTab.length == 1) return i_intaryTab[0]; else if ( i_intaryTab.length == 0 ) ) return 0; int o_intMax = i_intaryTab[0]; for ( int p_intI = 1; p_intI < i_intaryTab.length; p_intI++) if ( i_intaryTab[p_intI] > o_intMax ) o_intMax = i_intaryTab[p_intI]; return o_intMax; } // end method