값에의한 호출
Call By Value/Reference
package classtest;
class Pay1{
String name=""; //직원 이름
int pay=0; //급여
int comm=0; //보너스
int tax=0; //세금
public Pay1(){ }
public void name(String name){
[this.name](http://this.name/) = name;
}
public void tax(float f){
tax = (int)(pay * f);
}
public void pay(int pay){
this.pay= pay;
}
public void comm(int comm){
this.comm = comm;
}
public int earn(){
int total = (pay + comm)-tax;
return total;
}
}Call By Reference: 참조값에 의한 호출(Hash Code)
Call By Value/Reference 예제
String객체의 특징
Last updated