Discussion Forum : Introduction To Methods And Streams
Question -


What is the output of this program?


class binary {
public static void main(String args[]) {
int num = 17;
System.out.print(Integer.toBinaryString(num));
}
}
Options:
A .  1001
B .  10011
C .  11011
D .  10001
Answer: Option D

None.
output:
$ javac binary.java
$ java binary
10001



Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *