Difference between revisions of "Iterable Range Assignment"
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
=Code To Implement= | =Code To Implement= | ||
==minToMaxExclusive== | ==minToMaxExclusive== | ||
− | {{JavaToImplement|Ranges|minToMaxExclusive|range. | + | {{JavaToImplement|Ranges|minToMaxExclusive|range.warmup}} |
<nowiki>public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)</nowiki> | <nowiki>public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)</nowiki> | ||
Line 34: | Line 34: | ||
=Test= | =Test= | ||
− | {{TestSuite|RangesTestSuite|range. | + | {{TestSuite|RangesTestSuite|range.warmup}} |
Revision as of 05:50, 25 November 2022
Contents
Code To Investigate
Iterable
Iterator
Code To Implement
minToMaxExclusive
class: | Ranges.java | |
methods: | minToMaxExclusive | |
package: | range.warmup | |
source folder: | src/main/java |
public static Iterable<Integer> minToMaxExclusive(int min, int maxExclusive)
Example
class: | RangesExample.java | |
package: | range.example | |
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 | |
package: | range.warmup | |
source folder: | src/test/java |