Microsoft Interview Question: Write a program to implement ... | Glassdoor

Interview Question

Software Engineer Interview(Student Candidate) Bloomington, IN

Write a program to implement the Integer.parseInt

  () function.

Interview Answer

1 Answer


//Assume that str only contains integers
int a=0;
for(int i=0; i<str.length(); i++){
a = (a *10)+ (str.getCharAt(i)-48);
return a

Robin on Jan 11, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.