I am prompting the user to enter binary digits as a String. I am trying to declare and instantiate an array of boolean elements. The array should be equal to the number of digits in the String entered by user. Not sure what I'm doing wrong here but am thinking I need to use the String length() method?
public class Binary {
public static void main ( String [] args ) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter some binary digits > ");
String value = scan.nextLine();
boolean [] booleanArray = new boolean [value];
}
}
new boolean[value.length()]