Created
December 8, 2015 10:56
-
-
Save Yur-ok/6f99661f2b7a4a24f7fe 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 SquareMethod { | |
public static void main(String[] args) { | |
square(4.0); | |
square(5); | |
} | |
static void square(double number){ | |
double sqr = number * number; | |
System.out.println("Square is equal to: " + sqr + " m2"); | |
} | |
static void square(int number){ | |
int sqr = number * number; | |
System.out.println("Square in equal to: " + sqr + ".0 m2"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Результат должен возвращаться из метода, вывод в методе main()