Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 4 results for
cannotfindsymbol
- Page 1
not compiling right
Programming
Software Development
13 Years Ago
by fabricetoussain
for home work assignment we have to Implement a class Product. A product has a name and a price, for example new Product("Toaster", 29.95). Supply methods getName, getPrice, and reducePrice. Supply a program ProductPrinter that makes two products, prints the name and price, reduces their prices by $5.00, and then prints the prices …
Re: not compiling right
Programming
Software Development
13 Years Ago
by Slimmy
Your constructor is supposed to take two arguments. On line 5 you are not supplying any arguments. Besides that most of your code is also wrong.
Re: not compiling right
Programming
Software Development
13 Years Ago
by seanbp
Your Public class is public, and therefore in it's own file. [I]Maybe[/I] [URL="http://download.oracle.com/javase/1.5.0/docs/tooldocs/solaris/javac.html"]this[/URL] will help. See especially, [B]Compiling Multiple Source Files[/B]. [QUOTE=Slimmy;1421086]Your constructor is supposed to take two arguments. On line 5 you are not supplying …
Re: not compiling right
Programming
Software Development
13 Years Ago
by Eric Cute
As slimmy has pointed, your constructor takes two arguments [CODE] public Product(String n, double p) { n = "toaster"; p = 29.95; }[/CODE] It is advisable that if you overload a constructor (in this instance the NEW constructor) you create a default constructor that accepts no arguments. maybe you can add …
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC