
i am giving the string="101",for this output is "5".Please send me the code?

Hi Friend,
Try the following code:
class StringExample2
{
public static void main(String[] args)
{
String st = "101";
int base = 2;
int num = Integer.parseInt(st, base);
System.out.println(num);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.