Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cube {
- public int Side;
- int Volume;
- int Surface;
- private void setVolume() {
- this.Volume = Volume;
- }
- public int getVolume(int Side) {
- int volumeResult;
- volumeResult = (int) Math.pow(Side, 3);
- System.out.println(volumeResult);
- return volumeResult;
- }
- private void setSurface(){
- this.Surface=Surface;
- }
- public int getSurface(int Side){
- int surfaceResult;
- surfaceResult = (int) Math.pow(Side,2)*6;
- System.out.println(surfaceResult);
- return surfaceResult;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement