Binary digits: Difference between revisions
→{{header|Java}}
Line 2,795:
I am using implicit output.
=={{header|Java}}==
<p>
<syntaxhighlight lang="java">public class Main {▼
The <code>Integer</code> class offers the <code>toBinaryString</code> method.
</p>
System.out.println(Integer.toBinaryString(5));▼
System.out.println(Integer.toBinaryString(50));▼
</syntaxhighlight>
</syntaxhighlight>
<pre>101▼
<syntaxhighlight lang="java">
</syntaxhighlight>
<p>
If you printed these values you would get the following.
</p>
101
110010
10001100101000
</pre>
=={{header|JavaScript}}==
===ES5===
|