The Artima Developer Community

duplicate code

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

duplicate code

Posted by Bill Walker on 21 Jul 1998, 4:13 AM

In your example, you have a (minor) duplication of code in
your constructor, you could have used:

RGBColor(int r, int g, int b) {
setColor(r,g,b);
}

Did you do this deliberately since setColor() is
synchronized? What is the effect of sychronized(this)
when "this" is an object under construction?

Thanks,
BW




Replies:

Sponsored Links




Google
  Web Artima.com   
Copyright © 1996-2007 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us