So this first one is a simple one to explain what overloading is
when i first herd of this term i was like OMG its gonna be tough just bcoz it sounded too scary OVERLOADING
but seriously its nothing its just makink more than one function with same name in same class
below is a easy example for your understanding
i am not going to run them bcoz they all are running so go run them your self and if it creates a problem
comment and tell me
1----
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class a
{
void data(int a,int b){
System.out.println(""+a);
System.out.println(""+b);
}
void data(int a,int b,int c){
System.out.println(""+a);
System.out.println(""+b);
System.out.println(""+c);
}
}
class overload{
public static void main(String arg[])
{
a object=new a();
object.data(2,3);
object.data(2,3,4);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
STAY TUNED FOR MORE THERES LOT TO COME
when i first herd of this term i was like OMG its gonna be tough just bcoz it sounded too scary OVERLOADING
but seriously its nothing its just makink more than one function with same name in same class
below is a easy example for your understanding
i am not going to run them bcoz they all are running so go run them your self and if it creates a problem
comment and tell me
1----
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
class a
{
void data(int a,int b){
System.out.println(""+a);
System.out.println(""+b);
}
void data(int a,int b,int c){
System.out.println(""+a);
System.out.println(""+b);
System.out.println(""+c);
}
}
class overload{
public static void main(String arg[])
{
a object=new a();
object.data(2,3);
object.data(2,3,4);
}
}
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
STAY TUNED FOR MORE THERES LOT TO COME
No comments:
Post a Comment