#자바
이렇게 메소드의 입력으로 객체를 전달받는 경우에는 메소드가 입력받은 객체를 그대로 사용하기 때문에 메소드가 객체의 속성값을 변경하면 메소드 수행 후 객체의 변경된 속성값이 유지되게 된다.
If you want to change selection, open document below and click on "Move attachment"
05-3 Call by valuepdate 메소드를 호출하는 부분도 다음처럼 바뀌었다.
myUpdator.update(myCounter);
이제 변경된 클래스를 실행 해 보면 다음과 같은 결과가 출력된다.
before update:0
after update:1
myCounter 객체의 count 값이 1만큼 증가되었다.
<span>이렇게 메소드의 입력으로 객체를 전달받는 경우에는 메소드가 입력받은 객체를 그대로 사용하기 때문에 메소드가 객체의 속성값을 변경하면 메소드 수행 후 객체의 변경된 속성값이 유지되게 된다.
<span><body><html> Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details