Skip to content

Instantly share code, notes, and snippets.

@Yur-ok
Created December 8, 2015 10:56
Show Gist options
  • Save Yur-ok/6f99661f2b7a4a24f7fe to your computer and use it in GitHub Desktop.
Save Yur-ok/6f99661f2b7a4a24f7fe to your computer and use it in GitHub Desktop.
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");
}
}
@liuiv15
Copy link

liuiv15 commented Dec 9, 2015

Результат должен возвращаться из метода, вывод в методе main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment