Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Main {
- public static void main(String[] args) {
- Circle cr= new Circle();
- cr.setRadius(12);
- System.out.println(cr.toString());
- System.out.println("The Area of the Circle is : "+cr.getArea());
- Circle cr1= new Circle(12,"red");
- System.out.println(cr1.toString());
- System.out.println("radius of the circle is "+cr1.getRadius() + " AND color of circle is "+cr1.getColor());
- Cylinder cy1= new Cylinder(21, "red", 45);
- Cylinder cy2= new Cylinder(45,5);
- System.out.println(cy1.toString());
- System.out.println(" The volume of the cylinder is "+cy1.getVolume());
- System.out.println(cy2.toString());
- System.out.println(" The volume of the second cylinder is "+cy2.getVolume());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement