Question: Write A Java Program which does the following: o 1. Create seven variables, one for each of the primitive number types in Java, and initialize
Write A Java Program which does the following: o 1. Create seven variables, one for each of the primitive number types in Java, and initialize each variable with any appropriate value. o For byte variables, make sure the value is between -128 and 127. For short variables, make sure the value is between -32768 and 32767. o For long variables, use a value like 123456789012345678L (L indicates a long value). o For float variables, use a value like -320.00987F (F indicates a float value). 2. Print out the name of each variable and its value. 3. Modify the value of each variable with an assignment statement and print out the names of the variables and their new values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
