🎴 Flashcard Mode

MFC and Java Programming Quiz

Card1 / 20
Mastered0
Review0
QuestionClick to flip

byte b; final int a = 10; final int x = a; b = x; System.out.println("The value of b is " + b);

AnswerClick to flip back
A
10
💡 Explanation:

The code compiles and runs. Byte b is not explicitly initialized but gets value from final int x (which is compile-time constant 10). Since 10 fits in byte range (-128 to 127), the assignment is valid. Output is 10.

Change Mode