My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How can i have access the name object which has the biggest capacity ?

József Pallagi's photo
József Pallagi
·Feb 22, 2017
public static void biggestCapacity (HDDs [] array){
//HDDs h = new HDDs();
int max = array[0].getCapacity(); 
for (int i = 0; i < array.length; i++) {
if (array[i].getCapacity()>max) {
 max=array[i].getCapacity();
 }
 }
  System.out.println(max);     
  }