-1

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

KAPIL SHARMA
  • 437
  • 4
  • 8

1 Answers1

0

There is no such class Int in java.

Try this:

int convertIntoInteger=Integer.parseInt(String.valueOf(p0sition));

Integer class is used to parse data in int.

Abhay
  • 403
  • 3
  • 12