What is variable shadowing used for in a Java class?

后端 未结 5 1416
春和景丽
春和景丽 2020-11-22 14:53

I\'m reading my Deitel, Java How to Program book and came across the term shadowing. If shadowing is allowed, what situation or what purpose is there for it in a Ja

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 15:01

    One major purpose is to confuse people. It's bad practice and should be avoided.

提交回复
热议问题