• Post Reply Bookmark Topic Watch Topic
  • New Topic

this(Color.Red) ?  RSS feed

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone explain me this code from HFJ , chapter on constructors.



what does 'this (Color. Red) ;' do ?
specifically what is Color.Red ??

 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Color.red and Color.RED are static final fields of class java.awt.Color. Apparently this Color.Red is something similar.

As for "this(...)", it calls another constructor.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, the car is red. The default constructor calls the overloaded constructor.
 
K Srinivasan
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks :)
is


calling
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is indeed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!