im an absolute beginner and have following task that I need to complete but im totally confused and can't find anything online, hope someone can help out.
Task:
Let the variable “pattern” be declared as an integer with 32 bits and initialised with the bit pattern 0011 1101 0101 1110 0101 1111 0001 1010 (3D5E 5F1A). Print the variable, set Bit 7 to 1 and print again.
Given:
int pattern = ;
boolean ww = false;
int value = 0;
System.out.println("bitpattern = " + pattern + " --> " +Integer.toBinaryString(value));
When I understand that right, an integer is by default declared with 32bit so nothing to do for me for this part. But when I try to assign the number 0011 1101 0101 1110 0101 1111 0001 1010 to the "int pattern" I get the error "integer number too large".
where is my misconception ? Does anyone know a tutorial for that?
Thanks