DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Class review

  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Class review

    Thanks for the help provided.!
    Last edited by latin_papi; 11-02-2005 at 12:10 PM.

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    Smile Neat

    You have a clean and consistent coding style and your Colour class is easy
    on the eye & brain. I cannot see anything that "needs" to be shorter,
    well, perhaps except for the equals method:

    Code:
    public boolean equals(Colours c) {
        return  (this.r == c.r) && (this.b == c.b) && (this.g == c.g);
    }
    My point is; why test a boolean value for true or false before returning it
    to the caller when you might as well just return the boolean right away.

    I have two suggestions for additions:

    1: a hex setter & getter ?

    2: a getRandomColor() method ?
    Last edited by sjalle; 11-02-2005 at 02:31 AM.
    eschew obfuscation

Similar Threads

  1. Help with class/applet
    By none_none in forum Java
    Replies: 17
    Last Post: 04-28-2005, 03:00 PM
  2. Replies: 5
    Last Post: 10-17-2002, 01:58 PM
  3. Assembly class
    By Shailesh C.Rathod in forum .NET
    Replies: 2
    Last Post: 03-13-2002, 07:53 PM
  4. How To Do It - Shared Class Variables Part III
    By Patrick Ireland in forum .NET
    Replies: 5
    Last Post: 05-10-2001, 06:19 PM
  5. Calling base class methods
    By GR in forum Java
    Replies: 1
    Last Post: 11-09-2000, 05:38 PM

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