waltermilner

Untitled

Feb 17th, 2019
260
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 Test {
  2.  
  3.   // This works.
  4.   // main is overloaded
  5.   // Don't do it!! Just confuse people!!
  6.   public static double main(double x, double y)
  7.   {
  8.     return (x+y)/2;
  9.   }
  10.  
  11.   // execution starts here
  12.   public static void main(String[] d) {
  13.  
  14.     double v = main(3,4);
  15.     System.out.println(v); // 3.5
  16.  
  17.   }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment