473,473 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error when adding to pricelist

oll3i
679 Contributor
in flowershop class
Expand|Select|Wrap|Line Numbers
  1.  Cennik c= Cennik.getInstance(); //cennik means pricelist
  2. public void addFlower(String n,double c){
  3.  
  4.     c.setPricelist(n,c);
  5.  
  6.     }
  7.  
  8.  
in Pricelist class
Expand|Select|Wrap|Line Numbers
  1. public void setPricelist(String nazwaKwiat,double cena){       
  2.     pricelist.put(nazwaKwiat,cena);   
  3. }
  4.  
why eclipse says cannot invoke c.setPricelist(String,double) on the prymitive type double
Apr 11 '07 #1
2 1217
JosAH
11,448 Recognized Expert MVP
in flowershop class
Expand|Select|Wrap|Line Numbers
  1.  Cennik c= Cennik.getInstance(); //cennik means pricelist
  2. public void addFlower(String n,double c){
  3.  
  4.     c.setPricelist(n,c);
  5.  
  6.     }
  7.  
  8.  
in Pricelist class
Expand|Select|Wrap|Line Numbers
  1. public void setPricelist(String nazwaKwiat,double cena){       
  2.     pricelist.put(nazwaKwiat,cena);   
  3. }
  4.  
why eclipse says cannot invoke c.setPricelist(String,double) on the prymitive type double
Parameter 'c' is a double, which is a primitive so it doesn't have any methods;
exactly what Eclipse was trying to tell you. I guess you wanted to type:
Expand|Select|Wrap|Line Numbers
  1.  
  2.     // the member 'c' happens to be a PriceList
  3.     this.c.setPricelist(n,c);
I'd suggest a better name for member variable 'c'; maybe 'priceList' would do?

kind regards,

Jos
Apr 11 '07 #2
oll3i
679 Contributor
thank you again :)
Apr 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: quitaxe | last post by:
hi i have tomcat 3.3,jdk1.4 setup and running perfectly on my win 98 pc.i have tried to install apache cocoon on this but have failed.i'm getting the following error when i startup tomcat(after it...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: brenda.stow | last post by:
error msg " An error occured while referencing the object. You tried to run a visual basic procedure that improperly references a property or method of an object" This msg occurs everytime I add a...
1
by: Michael | last post by:
Hi, Any one know the problem of the following error: Thanks, m Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to...
9
by: Gustaf | last post by:
I'm confused about structured error handling. The following piece of code is a simplification of a class library I'm working on. It works, and it does what I want, but I'm still not convinced that...
5
DanielTNBaker
by: DanielTNBaker | last post by:
Basically gettting a "Declaration Syntax Error" do not understand what i have done wrong would appreciate it if someone could help. void Search_Client(void); void PriceList(void); void...
6
by: BlackMustard | last post by:
hi all, i get a run-time error '424': Object Required on the last line below, and i can't figure out why... Dim adoConn As New ADODB.Connection Dim adoCmd As New ADODB.Command Dim...
5
by: ravisuguna | last post by:
Hi, I am new to ajax.I am doing a pricelist form using ajax.I downloaded a sample code from the net(Dhtmlgoodies.com-shopping cart programme) and I am modifying...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.