This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.EnumSet; | |
/** | |
* EnumSet uses natural order which means the order in which the enum constants are declared. | |
*/ | |
public class EnumSetTest { | |
private enum MyEnum {A, B, C, D} | |
public static void main(String [] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def containsNeg1(nums: List[Int]) = nums.exists((x: Int) => x < 0) | |
def containsNeg2(nums: List[Int]) = nums.exists((x) => x < 0) | |
def containsNeg3(nums: List[Int]) = nums.exists(x => x < 0) | |
def containsNeg4(nums: List[Int]) = nums.exists(_ < 0) |
NewerOlder