0
Java - Difference between
What is the difference between this.setColor("Red") and this.setColor ="Red" ; ???
2 Answers
+ 3
Hi, kushal . this.setColor("Red") seems like a method of a current class taking one string argument called "Red" . What about this.setColor = "Red"; you are defining variable of a current class and setting in the string value "Red". This is the main difference. First one is the method, and second one is the variable.
+ 3
This is a method:
this.setColor("Red");
This is a atributte of class:
this.setColor="Red";