Method Overloading in java
![]() |
METHOD OVERLOADING |
Method overloading means more than one methods and different arguments(Parameters).
- Static method is data members.
- Static method is mandatory.
- Without main method not executing the program.
- Main method is not mandetory for compilation.
class Demo
{
public static void main(String [] a)
{
Demo d1=new Demo();
//d1.main();
//Demo.main();
//main();
System.out.println("Hello");
main(10);
}
public static void main()
{
System.out.println("main method");
}
public static void main(int a)
{
System.out.println("another method");
}
}
Output:-
main method
Hello
another method
Keep it upππ
ReplyDeleteNice work ππ
ReplyDeleteGood efforts di ππ
ReplyDeleteπππ
ReplyDeleteKeep it up ☺️
ReplyDeleteKnowledgeful material ππ❤️
ReplyDeleteVery niceπππ―π―
ReplyDeleteππ
ReplyDeleteππ
ReplyDeleteGood
ReplyDeleteKeep it up ☺️
ReplyDeleteππ
ReplyDelete