madhawaseeeee

overload

Sep 13th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public class overloadtute{
  2.    
  3.     public int area(int width){
  4.         return width * width;
  5.     }
  6.    
  7.     public String area(String height){
  8.         return  height;
  9.     }
  10.    
  11.     public static void main(String[] args) {
  12.         overloadtute x = (overloadtute) new Object();
  13.         System.out.println(x.area("ff"));
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment