I am new to java and facing a problem while converting a string into an integer. my coding goes here-
import java.util.Scanner;
class Binary{
public static void main(String args[]){
Scanner takeInput = new Scanner(System.in);
System.out.println("Please Give Your Input ====> ");
String binaryInput = takeInput.nextLine();
System.out.println("Your Input Is ====> "+binaryInput);
int lenGTH=binaryInput.length();
for(int i = lenGTH ; i >= 0 ; i--){
char pOsition = binaryInput.charAt(i);
int convertIntoInteger = Int.parseInt(pOsition);
int convertIntoDouble = Double.parseDouble(convertIntoInteger);
int getPower = 0;
getPower *= Math.pow(convertIntoDouble , 2);
System.out.println("Power of " + i + " index " + getPower);
}
}
}
I am giving the screenshot for error in command prompt:enter image description here