Does using the 'this' keyword affect Java performance?

前端 未结 2 1456
攒了一身酷
攒了一身酷 2021-01-11 22:59

Does using the this keyword affect Java performance at all?

In this example:

class Prog {
  private int foo;

  Prog(int foo) {
    this         


        
2条回答
  •  一向
    一向 (楼主)
    2021-01-11 23:29

    No it does not.

    The code with or without this keyword after compilation is exactly the same.

提交回复
热议问题