Hi I am new to Java and any help would be appreciated I am trying to convert an decimal number into binary and then making a left shift on that binary number. But it does not allow me left shift on string and it gives me exception of I try to convert it to integer.
int i = 40700;
iToBinary = Integer.toBinaryString(i);
i = Integer.parseInt(iToBinary);
i=i<<1;
What should be the optimal way to do this. I also need to convert the decimal to binary with the sign magnitude so I don't think a direct function like toBinaryString would work for me. But I would like to know how to do this.