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 Data Structures - Retired Getting There Class Review

Will it make a difference if I declare it as description = mDescription instead of vice versa ?

In the construction while declaring the description, author and date, will it make a difference if I declare it as :

description = mDescription instead of:

mDescription = description.

1 Answer

Jacob Bergdahl
Jacob Bergdahl
29,119 Points

Yes! It's a very big difference. The variable on the side is what is GETTING the value, and the variable on the right is the value that you are setting. Imagine this:

int x = 5;
int y = 10;
x = y
// x is now 10, and y is still 10.
// if we did it the other way around, they would both be 5.
Craig Dennis
Craig Dennis
Treehouse Teacher

Yes Jacob is correct Naren Budhwani ! The left side is the variable, the right side is the value.

If that cleared things up, please choose Best Answer so Jacob gets the credit.

If it didn't feel free to ask more!