Difference between revisions of "Iterable Range Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
  <nowiki>public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)</nowiki>
 
  <nowiki>public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)</nowiki>
  
=Performance=
+
=Output=
 +
{{Output|RangesDemo|range.assignment}}
 +
 
 
The code:
 
The code:
 
  <nowiki>for(int i : Ranges.minToMaxExclusive(4, 12)) {
 
  <nowiki>for(int i : Ranges.minToMaxExclusive(4, 12)) {

Revision as of 03:16, 31 July 2019

Code To Implement

minToMaxExclusive

class: Ranges.java Java.png
methods: minToMaxExclusive
package: range.assignment
source folder: src/main/java
public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)

Output

class: RangesDemo.java Presentation icon-72a7cf.svg
package: range.assignment
source folder: src/main/java

The code:

for(int i : Ranges.minToMaxExclusive(4, 12)) {
	System.out.println(i);
}

produces the output:

4
5
6
7
8
9
10
11

Test

class: RangesTestSuite.java Junit.png
package: range.assignment
source folder: src/test/java