Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NewClass1 {
- public static void main(String[] args){
- //Binary to Decimal :
- String binary = "1010";
- Integer decimal = Integer.parseInt( binary , 2);
- System.out.println(decimal);
- //Decimal to other :
- int d = 15;
- String bi = Integer.toBinaryString(d);
- System.out.println(bi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement