Qus:    What are the advantages of passing this into a method instead of the current class object itself?
Apr 24, 2022 17:36 Java 1 Answers Views: 363 GRANITE MALE ENHANCEMENT
Prev Next
Answers (1)
Rahs Feb 25, 2021 15:15
Answer:   As we know, that this refers to the current class object, therefore, it must be similar to the current class object. However, there can be two main advantages of passing this into a method instead of the current class object.
o this is a final variable. Therefore, this cannot be assigned to any new value whereas the current class object might not be final and can be changed.
o this can be used in the synchronized block.

Post Your Answer
Guest User

Not sure whare to join tuition right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect