Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

help me understand parse please

When we're discussing converting string to int in Java. I don't understand what parse means. Can someone help me understand it please?

3 Answers

Hi Alnoor,

try this video:

https://www.youtube.com/watch?v=vcx37lUQz5g

Generally parsing is:

"Parsing is to read the value of one object to convert it to another type. For example you may have a string with a value of "10". Internally that string contains the Unicode characters '1' and '0' not the actual number 10. The method Integer.parseInt takes that string value and returns a real number" citationt: Martin Harrys

The uppercased "Integer" is a wrapper class. It contains the method parseInt that parse = analyse the String an returns a real number.

Thank you! This helped me understand it really well :) You rock!

OscarRyz does a great job explaining the basics of parse. You can find his explanation here:

http://stackoverflow.com/questions/787735/what-is-parse-parsing

Thank you for trying, however I was able to better understand when explained in detail, like Grigorij Schleifer explained it. :) Thank you really for trying!

All that matters is that you understand what you need :)

Thank you for asking :)