Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 85a2325

Browse files
committed
Completed Secrets Exercism exercise
1 parent 839bcd0 commit 85a2325

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Java/Exercism/Secrets.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class Secrets {
2+
public static int shiftBack(int value, int amount) {
3+
return value >>> amount;
4+
}
5+
6+
public static int setBits(int value, int mask) {
7+
return value | mask;
8+
}
9+
10+
public static int flipBits(int value, int mask) {
11+
return mask ^ value;
12+
}
13+
14+
public static int clearBits(int value, int mask) {
15+
return value & ~mask;
16+
}
17+
}

0 commit comments

Comments
 (0)