• Post Reply Bookmark Topic Watch Topic
  • New Topic

New to java, please, I need help  RSS feed

 
Robert Jameson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Help,
I�m trying to setup an application that allows a user to build an ice cream cone, I managed to get the Exception file to compile, but the IceCreamCone file gives me the following error message when I try to compile, I think the problem is in the exception file constructor but not sure how to fix:

IceCreamCone.java:16: cannot find symbol
symbol : constructor IceCreamConeException()
location: class IceCreamConeException
throw(new IceCreamConeException());
^
1 error

Can anyone tell me what I am not seeing, I don�t have a lot of experience and in desperate need of some guidance.



 
BV Boose
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you're throwing IceCreamConeException() but your exception constructor is IceCreamConeException(String flavor, int scoops). The method arguments don't match, so you're calling a constructor that doesn't exist.
[ December 04, 2008: Message edited by: BV Boose ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch,

Add another constructor inside your IceCreamConeException class without an arguments.

like this


and try..

cheers !!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class mate?

change of name?

http://www.coderanch.com/t/417046/java/java/help-code
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!