Jump to content

multiple ints


BurritoBug

Recommended Posts

but if you're using it in an if statement why cant you

just return true or false instead

It's against convention to have more than one return per method.

The reason of that, it to make debugging easier. You don't have your methods randomly exiting at different lines.

Edited by dreamliner
Link to comment
Share on other sites

TBH my favorite way to do interfaces is to use an array of integer arrays.

int[][] interfaces = {{150,1},{150,2},{350,6}};

Then for loop through the int [][].

public int[] getOpenInterface(int[][] interfacesToCheck){
 for(int[] interface: interfacesToCheck){
  if(getInterface(interface[0])!=null && getInterface(interface[0]).isValid() && getInterface(interface[1]).siValid())
   return interface;
 }
 return null
}
Edited by Deffiliate
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...