subject:คุณลักษณะของ overloading method
content:เป็น method หลาย method ที่มีชื่อเดียวกัน และอยู่ภายใน class เดียวกัน หรือ class ที่สืบทอดกัน
แต่ต่างกันตรง ชนิด หรือ จำนวน ของ parameter
example:class Person
{
private String name;
public void setName ( String name )
{
this.name = "FullName : " + name;
}
public void setName ( String firstname, String lastname )
{
this.name = "FirstName : " + firstname + " LastName : " + lastname;
}
}
Person bamboo = new Person ( );
bamboo.setName ( "bamboolabcode.com" );
Person function = new Person ( );
function.setName ( "function", "in.th" );