Is passing 'this' in a method call accepted practice in java

后端 未结 10 1201
无人共我
无人共我 2021-01-30 19:32

Is it good/bad/acceptable practice to pass the current object in a method call. As in:

public class Bar{
    public Bar(){}

    public void foo(Baz baz){
              


        
10条回答
  •  面向向阳花
    2021-01-30 19:47

    this stands for the current object. What you are doing is sytatically correct but i don't see a need of this if you are calling the method in the same class.

提交回复
热议问题