Which is the predefined method available in Java to convert decimal to binary numbers?

Huỳnh Hiền

New member
Which is the predefined method available in Java to convert decimal to binary numbers?
A. toBinaryInteger(int)
B. toBinaryValue(int)
C. toBinaryNumber(int)
D. toBinaryString(int)
 
Answer: D
Explanation: The method toBinaryString() takes an integer argument and is defined in java.lang package. Usage is java.lang.Integer.toBinaryString(int) this returns the string representation of the unsigned integer value.
 

Tìm kiếm

Back
Top