Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. Circle cr= new Circle();
  8. cr.setRadius(12);
  9. System.out.println(cr.toString());
  10. System.out.println("The Area of the Circle is : "+cr.getArea());
  11. Circle cr1= new Circle(12,"red");
  12. System.out.println(cr1.toString());
  13. System.out.println("radius of the circle is "+cr1.getRadius() + " AND color of circle is "+cr1.getColor());
  14. Cylinder cy1= new Cylinder(21, "red", 45);
  15. Cylinder cy2= new Cylinder(45,5);
  16. System.out.println(cy1.toString());
  17. System.out.println(" The volume of the cylinder is "+cy1.getVolume());
  18. System.out.println(cy2.toString());
  19. System.out.println(" The volume of the second cylinder is "+cy2.getVolume());
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement