Created
December 8, 2015 13:36
-
-
Save Yur-ok/7fd6f7418ba9646c92dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Lesson2.KeyPoin1; | |
/** | |
* Created by Юрий on 08.12.2015. | |
*/ | |
public class SquareOverriding { | |
public static void main(String[] args) { | |
System.out.println(square(5)); | |
System.out.println(square(3.0)); | |
} | |
static double square(double number) { | |
number = number * number; | |
return number; | |
} | |
static int square(int number) { | |
number = number * number; | |
return number; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment