我可以在方法中使用this
嗎?或者它是錯誤的嗎?在方法中使用「this」
領域:
private int level;
private String name;
方法
public void check(String Name, int newlevel)
{
if (this.level < newlevel)
{
this.level = newslevel;
this.Name = Name;
System.out.println("." Name+" you are in the right level);
}
else
{
System.out.println("Sorry your are not on the right level");
}
}
歡迎SO,Ghassar :) – Ben