• Post Reply Bookmark Topic Watch Topic
  • New Topic

polymorphism question  RSS feed

 
Phillip Kuon
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code trying to test out polymorphism




the error is it can't find the symbol Circle on the line:
Shape c = new Circle()

shouldn't this work?
 
Stefaan Dutry
Ranch Hand
Posts: 33
Java Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You gave the answer yourself

in your code:
Shape c = Circle();


in your comment:
Shape c = new Circle();


Word missing in your code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!