Class Static Circle

298 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
298
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Class Static Circle

  1. 1. class StaticCircle { public double radius; double pi=3.14; public void circle(double radius) { this.radius=radius; } public double area() { double a = radius*radius; double piValue= a*pi; return piValue; } public static void main(String[] args) { StaticCircle staticCircle = new StaticCircle (); staticCircle.circle(10); double i = staticCircle.area(); System.out.println("The area is " + i); } }

×