Implementation of Java method overloading (changing the data types)
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Area of Rectangle 31.400000000000002 Area of Rectangle 50 kodingwindow@kw:~$
Implementation of Java method overloading (changing the number of arguments)
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Area of Square 25 Area of Rectangle 50 kodingwindow@kw:~$
What Next?
How to overload the main() method in Java
Implementation of Java method overriding
Java Abstraction
Advertisement