DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    15

    its probably something really daft but it wont work!

    here is the code

    {
    double a = double.parseDouble(txtRadius.getText());
    double b = 3.14;
    double c = a * b;
    txtCircumference.setText(String.valueOf(c));
    }

    It is a small piece of code to calculate the circumference of a circle, when i compile it on netbeans I get a class error.

    Any help would be appreciated!

    Ta,
    Steve

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    parseDouble is a static method of the Double class (not the double class...)
    so:
    Code:
    double a = Double.parseDouble(txtRadius.getText());
    eschew obfuscation

  3. #3
    Join Date
    Oct 2005
    Posts
    15
    thanks!

Similar Threads

  1. Data Entry Work
    By Anjana Jonathan in forum Careers
    Replies: 5
    Last Post: 07-03-2006, 03:15 AM
  2. Replies: 3
    Last Post: 02-23-2003, 02:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links