Single Choice Not Set

QGuess the output of the following program -
public class NumberSystem{
    public static void main(String[] args){
        
        int hexVal = 0x1a;
        System.out.println("Value : " + hexVal);
        
    }
}

ID: #2084 Java Data Types and Variables - MCQ 6,887 views
Question Info
#2084Q ID
Not SetDifficulty
Java Data Types and Variables - MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 32
  • B 24
  • C 26
  • D 25
Correct Answer

Explanation

0x1a = 0001 1010
     = 2^1 + 2^3 + 2^4
     = 2 + 8 + 16
     = 26

Share This Question

Challenge a friend or share with your study group.