Method Overloadding Using Java

Java is fully object oriented programming language.java consist Methodoverloading. use of this method we can write program with same method name, same class but different arguments.


class Test
{
public void display() // this is our simple method or it's called method
{
System.out.println("Hello world...CodersArt...!!");
}
public void display(String a)
{
System.out.println(a);
}
}
class MethodOverloadingDemo
{
public static void main(String[] args)
{
Test t = new Test();
t.display();
t.display("Hello friends world is open source...");
}
}



Comments