Problem. Given a piece of Java code below in which we define five variables a, b
ID: 3750652 • Letter: P
Question
Problem. Given a piece of Java code below in which we define five variables a, b, c, d, and e
public class problem1 {
public static void main(String[] args) {
short a = 1200;
short b = -200;
char c = 'x';
char d = 'y';
float e = (float) 6.25;
}
}
What is the 16-bit binary number of variable a stored in memory
Rewrite the 16-bit binary number of variable a into the hexadecimal number
What is the 16-bit binary number of variable b stored in memory
Rewrite the 16-bit binary number of variable b into the hexadecimal number
What is the 8-bit binary number of variable c stored in memory
Rewrite the 8-bit (1 byte) binary number of variable c into the hexadecimal number
What is the 8-bit binary number of variable d stored in memory
Rewrite the 8-bit binary number of variable d into the hexadecimal number
What is the 32-bit binary number of variable e stored in memory
Rewrite the 32-bit binary number of variable e into the hexadecimal number
Explanation / Answer
What is the 16-bit binary number of variable a stored in memory
Ans :- 00000100 10110000
Rewrite the 16-bit binary number of variable a into the hexadecimal number
Ans:- 0x04B0
What is the 16-bit binary number of variable b stored in memory
Ans :-11111111 00111000
Rewrite the 16-bit binary number of variable b into the hexadecimal number
Ans:- 0xFF38
What is the 8-bit binary number of variable c stored in memory
Ans:- 01111000
Rewrite the 8-bit (1 byte) binary number of variable c into the hexadecimal number
Ans:- 0x78
What is the 8-bit binary number of variable d stored in memory
Ans:- 01111001
Rewrite the 8-bit binary number of variable d into the hexadecimal number
Ans:- 0x79
What is the 32-bit binary number of variable e stored in memory
Ans:- 01000000 11001000 00000000 00000000
Rewrite the 32-bit binary number of variable e into the hexadecimal number
Ans:- 0x40C80000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.