Question: Explore Java Datatypes (40 pts) Procedure For each statement below, record what you expect the result to be. Then, write Java code to compute the
- Explore Java Datatypes (40 pts)
Procedure
- For each statement below, record what you expect the result to be. Then, write Java code to compute the result. (Note: no points lost for incorrect expected value answers)
| Statement | Expected Value | Computed Value |
| f = 3 * 9 / 4 |
|
|
| float f = (2 * 5) / 4.0f |
|
|
| int y = 3 + c |
|
|
| char c = Math.min(a, A) |
|
|
| int x = 2147483647 + 1 |
|
|
- Java primitives have fixed sizes in memory. A primitive has a minimum and maximum value.
Record the number of bits in memory assigned to each type. What is the relationship between the values in this table?
| Type | Size in Memory | Min-Value | Max-Value |
| int |
|
|
|
| boolean |
|
|
|
| char |
|
|
|
| String |
|
|
|
- Where did you find this information? _______________________________________
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
