Using byte
Variable
class ByteDemo { public static void main (String[] args) { //The byte type store values in the range from -128 to 127 //We are creating a variable named maximumUsersPerGroup and storing the value 120 byte maximumUsersPerGroup = 120; System.out.println("maximumUsersPerGroup value is " + maximumUsersPerGroup); //TODO //Try changing the value of maximumUsersPerGroup to 128 and Run again //Create your own byte type variable //Assign a value //And print the output } }
Activity
- Create a new byte variable called
minimumAllowedAge
and assign the value12
. - Print the variable to the console using
System.out.println()
;
Output
Your output should be as follows
120
12