• Post Reply Bookmark Topic Watch Topic
  • New Topic

Object a = new Circle() VS Circle a = new Circle()??  RSS feed

 
Dmitry Pidd
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Didn't understand it from the book
what advantages and disadvantages it gives?

I understand about overriding comparison methods, but why would I
"create a new Object of type Circle" instead of "create a new Circle of type Circle", cant get the difference..

--------------------------
sorry, just learning
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if all your doing is what you show above, the answer is "there is not much advantage to it".

However, that's like saying "I just need to tap a nail in a millimeter, so I'll use my wrench rather than a pneumatic nail gun".

Look at this thread, which should give you an idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!