aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes max value of an array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "max value of an array" Watch "max value of an array" New topic
Author

max value of an array

Steffen K
Greenhorn

Joined: May 15, 2001
Posts: 3
hi!
i have an array with int values and want the maximum value of this array... are there any methods from java to make this available... any ideas?
greetings
Steffen
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Use "length". For example:
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"Steffen K",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Aleksey Matiychenko
Ranch Hand

Joined: Apr 03, 2001
Posts: 178
Length returns the length of an array not the max value of the elements in the array.
A simple loop through would calculate max.
 
 
subject: max value of an array