본문 바로가기

콩's EDUCATION/콩's JAVA_RUN

CallByValue

CallByValue 예제


 

 

class Test{
 void addInt(int i){
  System.out.println(i++);
 }
}
public class CallByValueTest {
 public static void main(String[] args) {
  Test t = new Test();
  
  int j = 10;
  t.addInt(j);
  System.out.println("t.addInt(j) 호출 : "+j);  
 }

}

 

 

CallByValueTest.java