What can scanners scan instead of input. And how do I use it?
Hello. I was trying to make an program that converts binary numbers to decimal numbers, and then convert back to binary and display on the screen. But when I tried to scan the Binary number column by column I couldn't do it because I didn't know how to fill the parameter in the new scanner object. Please help me. long binary1; long binary2; Scanner scan = new Scanner(System.in); System.out.println("Input first binary number."); binary1 = scan.nextLong(); System.out.println("Input second binary number."); binary2 = scan.nextLong(); long[] powersOf2 = { 2^0,2^1,2^2,2^3,2^4,2^5,2^6,2^7,2^8,2^9,2^10,2^11,2^12,2^13,2^14,2^15 }; Scanner binaryscan = new Scanner(I dont know what to place here); I want to later make an array with integers from the each column. Many thanks.