Jave Coding

1
Ok, Im pretty comfortable with basic Java, but there's one thing that confuses me...

Why does the 'This' claimer for variables exist? People really should not be encouraged, in my opinion, to use the same name for variables as you are for fields.

My tutor says that some variable names are too obvious not to use, but I simply tag the name of the Method onto it, so age becomes, for example isSeniorAge if the method is called isSenior, etc.

I'm still trying to figure out the relevance of this command, it just strikes me that it's GOTO, waiting to happen all over again.

Return to “General Discussion”