Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package day2;
- public class Q1 {
- private double r=1.0;
- private String color="red";
- Q1()
- {
- }
- Q1(double r)
- {
- }
- double getred()
- {
- return r;
- }
- double getarea()
- {
- double area=3.14*r*r;
- return area;
- }
- public static void main(String arg[])
- {
- Q1 c=new Q1();
- System.out.println(c.getarea());
- }
- }
Add Comment
Please, Sign In to add comment