글수 77
class overLoading1
{ int x;
String y;
public overLoading1(int x,String y){
this.x =x;this.y =y;
}
public void setValue(int x){this.x=x;}
public void setValue(String y){this.y=y;}
public void printAll(){
System.out.printf("x = %d ,y = %s n",x,y);
}
public static void main(String[] args)
{
overLoading1 ob = new overLoading1(1818,"값값값");
ob.setValue(23);
ob.printAll();
ob.setValue("aaaaaaaaa");
ob.printAll();
}
}
{ int x;
String y;
public overLoading1(int x,String y){
this.x =x;this.y =y;
}
public void setValue(int x){this.x=x;}
public void setValue(String y){this.y=y;}
public void printAll(){
System.out.printf("x = %d ,y = %s n",x,y);
}
public static void main(String[] args)
{
overLoading1 ob = new overLoading1(1818,"값값값");
ob.setValue(23);
ob.printAll();
ob.setValue("aaaaaaaaa");
ob.printAll();
}
}


