Case:1
class A
{
private int i=0;
public void display()
{
this.getValue();
}
private int getValue()
{
return i+2;
}
}
Case:2
class B
{
public void display()
{
int i=0;
this. getValue(i);
}
private int getValue(int i)
{
return i+2;
}
}
display()를 호출 할 때마다 두 경우 모두 "i"선언이 큰 차이 (글로벌 액세스 제외)가 있습니까?변수 선언?
사용중인 언어에 대해 언급하고 싶을 수 있습니다. 대답은 아마도 C/C++/C#/Java 제품군에서 동일 할 것이지만 그렇지 않을 수도 있습니다. – ctford