[Bluej-discuss] confusion over =

Lon Levy LXL at oregon.k12.wi.us
Thu Nov 29 22:59:17 GMT 2007


I would be careful with using "is equal" for "==".  Instead, I use "is the same as".  This is important because in Java the "==" is overloaded to mean 'the same value' for primitives and 'the same instance' for objects.  Then Java really muddies the waters where some Strings are "==" the same and others are not, even when they are the same values.  (More on this if you wish).  Use of methods can clarify what is going on.

Regards,

Lon.

Lon Levy, MS-CSEd
Computer Science Teacher
Volunteer Computer Club Advisor
Oregon High School
608-835-1316
 
Lon.Levy at oregonsd.org
LXL at oregon.k12.wi.us
cs at levytree.net

non somnos requiem


>>> <atraub at students.rmc.edu> 11/29/2007 3:28 PM >>>

My math centered students tend to have some trouble with the equal sign.  Most others
tend to pick it up somewhat quickly,  Strangely, the "+=" operator seems less cryptic
to the math majors.  When I am teaching the "==" sign to someone, I use the words  
"Is assigned." So, to explain a=b+c, I would say "a is assigned the value of  b plus c."   
This has worked well for me. In conditionals I explain the two equal signs as "is equal."  
I try to encourage students to use this vocabulary, when they read code or add comments
to it.



More information about the bluej-discuss mailing list