In the following piece of code i am trying to enter a 8 digit binary number then manipulate each digit seperatly.
import java.util.Scanner;
public class binCoverstion2{
private static Scanner kbd = new Scanner(System.in);
public static void main (String[] args){
int bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7, decNumber;
System.out.println("Enter a 8 digit binary number then hit enter.");
String binaryNum = kbd.nextLine();
bit0 = binaryNum.charAt(0);
System.out.println(bit0);
The output of bit0 is just to see what the value was set too. the input i gave it was 10011001, but bit0 was set to 49. Why?