•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 403,588 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,100 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
This program consists of two functions in one class. It is the driver program for the CircleClass.java file.
Last edited : Feb 24th, 2007.
package circle; public class Circle { public static void main(String args[]) { CircleClass myCircle = new CircleClass(10); CircleClass yourCircle = new CircleClass(); printout(myCircle); printout(yourCircle); myCircle.setCircumference(25); printout(myCircle); myCircle.setCircumference(175); printout(myCircle); } public static void printout(CircleClass x) { System.out.print("\n\n\tRadius = " + x.getRadius()); System.out.print("\n\tCircumference = " + x.getCircumference()); System.out.print("\n\tArea = " + x.getArea()); } }
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)