The Value of 0xFF Number and Its Uses With & Operation in Java Article by Abdallah Sawan

This commit is contained in:
AbdallahSawan 2020-10-22 14:11:18 +03:00
parent 06419d4deb
commit 12b927e2ae
2 changed files with 2 additions and 2 deletions

View File

@ -15,6 +15,6 @@ public class Number0xff {
}
public static int getAlfa(int rgba) {
return rgba >> rgba & 0xff;
return rgba & 0xff;
}
}

View File

@ -22,7 +22,7 @@ public class Number0xffUnitTest {
@Test
public void givenColor_whenGetRedColor_thenExtractRedColor() {
int rgba = 272214023;
int expectedValue = 64;
int expectedValue = 16;
assertEquals(Number0xff.getRedColor(rgba), expectedValue);
}