id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

rmueller@lasacs.com > myParseInt
prev  |  next  |  chance

The Java Integer class provides a static method that converts a string to an int. Complete the myParseInt method below to accomplish the same thing without using this method :).

Given a string containing a set of characters representing a number, return the integer value represented by the string. The characters in the string are either decimal digits, a decimal point, a minus sign, or a plus sign.


myParseInt("125") → 125
myParseInt("-345") → -345
myParseInt("56.7") → 56

...Save, Compile, Run (ctrl-enter)

public int myParseInt(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy