Created
February 21, 2011 20:32
-
-
Save thetekst/837665 to your computer and use it in GitHub Desktop.
square
This file contains 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
public class MyClass { | |
private double width; | |
private double height; | |
void setValues(double width, double height){ | |
this.width = width; | |
this.height = height; | |
} | |
double getSq(){ | |
return width * height; | |
} | |
public static void main(String[] args) { | |
MyClass peremennaya = new MyClass(); | |
peremennaya.setValues(5,2); | |
System.out.println(peremennaya.getSq()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment