This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

abstract class

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The prof. ask us to use abstract class for this kind of program but it seem that i can't test it.
this is my java program



and the error that i have is here





 
lowercase baba
Posts: 12753
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what exactly is the error you are getting?
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this kind of error and i already indicated with the arrow (=>)

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
c cannot be resolved to a type
Cannot instantiate the type Cylinder

at oops.Test.main(Test.java:53)
 
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

and the error that i have is here . . .


What error and where exactly? In order to get the best answer(s) you need to be specific about the problem you're facing and TellTheDetails.

Besides the fact that the code you provided cannot be compiled (as such), the only detail I can see being wrong for now is that you try to instantiate an object of abstract class, so I would recommend you read this.
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the only that it seem for me to work only using the abstract only in point and just leave the circle and cylinder without a abstract
in which will look like this
output is this
3.141592653589793
Please select from the menu below
1. Instantiate a Circle
3. Instantiate a Cylinder
Enter your choice

i guess i can only use abstract in parent or the head of the class which is the Point
 
Kemal Sokolovic
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you understand the concept and purpose of abstract classes?
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kemal Sokolovic wrote:Do you understand the concept and purpose of abstract classes?


I think im not familiar with that yet, perhaps can you explain it
 
Kemal Sokolovic
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you might review the tutorial I gave you in the previous post. Also similar topics were covered couple of times here at the forum, so if you search a bit you can find a lot of information (like this).
 
Andres John
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kemal Sokolovic wrote:Well, you might review the tutorial I gave you in the previous post. Also similar topics were covered couple of times here at the forum, so if you search a bit you can find a lot of information (like this).



thank you for the link
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!