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

I need to use the .length for int but it doesn't let me, is there something else I can use for an integer

I'm trying to write a method that returns the length of an integer, in the java course it shows how we can use misses.length() to return the length of a String, so I was wondering if there was something else for Integers

1 Answer

In Java number types have a fixed length or width as it's called to accommodate any number within a given range in binary notation. For int's and Integers it's 32 bits (binary digits).