User Name Password Register
DaniWeb IT Discussion Community
All
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
Sep 20th, 2004
Views: 2,489
This program consists of two functions in one class. It is the driver program for the CircleClass.java file.
Last edited : Feb 24th, 2007.
java Syntax | 2 stars
  1. package circle;
  2. public class Circle
  3. {
  4. public static void main(String args[])
  5. {
  6. CircleClass myCircle = new CircleClass(10);
  7. CircleClass yourCircle = new CircleClass();
  8. printout(myCircle);
  9. printout(yourCircle);
  10. myCircle.setCircumference(25);
  11. printout(myCircle);
  12. myCircle.setCircumference(175);
  13. printout(myCircle);
  14. }
  15. public static void printout(CircleClass x)
  16. {
  17. System.out.print("\n\n\tRadius = " + x.getRadius());
  18. System.out.print("\n\tCircumference = " + x.getCircumference());
  19. System.out.print("\n\tArea = " + x.getArea());
  20. }
  21. }
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 3:02 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC