This site requires JavaScript, please enable it in your browser!
Greenfoot back

Recent Comments | Show All

lehrerfreund

2021/10/26

Interesting discussion about using the keyword this. I personally _force_ my students to always use this when referencing a class variable. This might be redundant in a lot of casses, even confusing - but it has a huge advantage: My students are absolutely aware what "this" is. If we pass this to another class or if we are referencing other objects (like xy.getX() vs. this.getX()) they have no problems with this paradigm. So I keep the this-force rolling :-)
lehrerfreund

2018/7/9

Ay! Got busted!