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 Java Basics Perfecting the Prototype Reviewing Our Feedback

Samantha Degges
Samantha Degges
361 Points

Capitalization of objects and variables

Why do some objects get capitalized and variables are always capitalized? (String is always capitalized when declaring variable types) When referring to objects, console is not capitalized by System is. Does it matter? Why or why not?

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Samantha;

Welcome to Treehouse!

Great questions. Does it matter, yes. Java is very case sensitive and you will get errors if you try to declare Strings as string instead of String or Int instead of int. Why the difference? In short int is a primitive data type, String derives from Object and is a class.

It is all part of the Java Code Conventions.

That probably just raised more questions than it answered, but there you have it.

Happy coding,

Ken

Samantha Degges
Samantha Degges
361 Points

Thanks. I'll just have to read the Code Conventions to get up to date on that. Glad there's a reason!