Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Rectangle;
- public class excercise2 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Rectangle box = new Rectangle(100, 100, 50, 50);
- double width = box.getWidth();
- double height = box.getHeight();
- double perimeterRect = (2 * height) + (2 * width);
- System.out.println(perimeterRect);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment