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

  1. 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

  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

  1. Where did you find this information? _______________________________________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!