package LearnJava;
public class TestMethodOverLoading {
int a;
float b;
double d;
TestMethodOverLoading obj;
TestMethodOverLoading obj1;
TestMethodOverLoading obj2;
void test1() {
System.out.println("I am method with no argument");
}
void test1(int a) {
System.out.println("I am method with one argument");
}
void test1(int a, int b) {
System.out.println("I am method with two argument");
}
void test1(TestMethodOverLoading a) {
System.out.println("I am method with class type argument");
}
void test1(TestMethodOverLoading a, TestMethodOverLoading b) {
System.out
.println("I am method with class type argument with two argument");
}
void test1(int a, double b) {
System.out.println("I am method with two argument");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TestMethodOverLoading obj = new TestMethodOverLoading();
obj.test1();
obj.test1(5);
obj.test1(obj);
obj.test1(obj, obj);
}
}
public class TestMethodOverLoading {
int a;
float b;
double d;
TestMethodOverLoading obj;
TestMethodOverLoading obj1;
TestMethodOverLoading obj2;
void test1() {
System.out.println("I am method with no argument");
}
void test1(int a) {
System.out.println("I am method with one argument");
}
void test1(int a, int b) {
System.out.println("I am method with two argument");
}
void test1(TestMethodOverLoading a) {
System.out.println("I am method with class type argument");
}
void test1(TestMethodOverLoading a, TestMethodOverLoading b) {
System.out
.println("I am method with class type argument with two argument");
}
void test1(int a, double b) {
System.out.println("I am method with two argument");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
TestMethodOverLoading obj = new TestMethodOverLoading();
obj.test1();
obj.test1(5);
obj.test1(obj);
obj.test1(obj, obj);
}
}
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteCore Java Training in Electronic city