It’s a good point. But as far as I know, opt-functions return non-null value.

For example:

returns fallback if there’s no key name in JSONObject, but sometimes you need null.

optString without second argument is the same as optString(key, "").

Please correct me if I’m missing something.

--

--

--

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Nekrasov

Alex Nekrasov

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.

More from Medium

The Next Big Thing About Medium

provide illustrations to your written content

To my Medium followers…

An Epic Failure to Round the Football