java - Finding numbers within a certain range in an arraylist -
i have integer array list collects numbers user inputs. have display numbers within array <= 50, using method. how can this?
public static double levelr(list<integer> marks){ (int i= marks.get(0); i<= 50; i++){ system.println(marks.get(i)); } this have method far, i'm clueless on next.
you not need sort array solve problem. here do:
- start writing loop prints elements of array regardless of value
- modify loop skip printing numbers above 50. there 2 ways of doing - adding
ifusescontinueon numbers above 50, or addifaround printing.
Comments
Post a Comment