Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package puck;
- public class Puck {
- public static void main(String[] args) {
- Disk saucer = new Disk(10, 0.02);
- System.out.println("Disk radius: " + saucer.getRadius());
- System.out.println("Disk surface area: " + saucer.area());
- System.out.println("Disk volume: " + saucer.volume());
- Disk plate1 = new Disk(12, 0.05);
- Disk plate2 = new Disk(12, 0.07);
- if (plate1.equals(plate2)) {
- System.out.println("Objects are equal.");
- } else {
- System.out.println("Objects are not equal.");
- }
- System.out.println(plate1);
- System.out.println(plate2);
- Weight puck1 = new Weight(.5);
- Weight puck2 = new Weight(.6);
- if(puck1 == puck2){
- System.out.println("They are equal in weight");
- }else{
- System.out.println("They are not equal in weight");
- }
- System.out.println(puck1);
- System.out.println(puck2);
- }
- }
Add Comment
Please, Sign In to add comment