473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

just error

oll3i
679 512MB
Expand|Select|Wrap|Line Numbers
  1.  
  2. public class Kwiaciarnia {
  3.   Cennik c= Cennik.getInstance();
  4.  
  5.   public Kwiaciarnia(){}
  6.   c.setCennik("Roza Czerwona",5.0);
  7.   c.setCennik("Roza Biala",5.0);
  8.   c.setCennik("Roza Zolta",5.0);
  9.   c.setCennik("Roza Czarna",10.0);
  10. }
  11.  
  12.  
  13.  
  14.  
  15.  
  16. public class Cennik {
  17.      private static Cennik instance = null;
  18.      Map<String,Double> cennik = new HashMap<String,Double> ();
  19.  
  20.        private Cennik() {  // prywatny konstruktor
  21.        }
  22.  
  23.        public static Cennik getInstance() {
  24.           if(instance == null) {
  25.              instance = new Cennik();
  26.  
  27.           }
  28.           return instance;
  29.        }
  30.  
  31. public void setCennik(String nazwaKwiat,double cena){       
  32.     cennik.put(nazwaKwiat,cena);   
  33. }
  34. }
  35.  


why eclipse highlights
c.setCennik("Roza Czerwona",5.0);
c.setCennik("Roza Biala",5.0);
c.setCennik("Roza Zolta",5.0);
c.setCennik("Roza Czarna",10.0);
as an error
Mar 30 '07 #1
2 1279
r035198x
13,262 8TB
Expand|Select|Wrap|Line Numbers
  1.  
  2. public class Kwiaciarnia {
  3. Cennik c= Cennik.getInstance();
  4.  
  5. public Kwiaciarnia(){}
  6. c.setCennik("Roza Czerwona",5.0);
  7. c.setCennik("Roza Biala",5.0);
  8. c.setCennik("Roza Zolta",5.0);
  9. c.setCennik("Roza Czarna",10.0);
  10. }
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. public class Cennik {
  18.      private static Cennik instance = null;
  19.      Map<String,Double> cennik = new HashMap<String,Double> ();
  20.  
  21.      private Cennik() { // prywatny konstruktor
  22.      }
  23.  
  24.      public static Cennik getInstance() {
  25.      if(instance == null) {
  26.      instance = new Cennik();
  27.  
  28.      }
  29.      return instance;
  30.      }
  31.  
  32. public void setCennik(String nazwaKwiat,double cena){     
  33.     cennik.put(nazwaKwiat,cena); 
  34. }
  35. }
  36.  


why eclipse highlights
c.setCennik("Roza Czerwona",5.0);
c.setCennik("Roza Biala",5.0);
c.setCennik("Roza Zolta",5.0);
c.setCennik("Roza Czarna",10.0);
as an error

Read what the error message says. It will tell you how to fix the problem.
Mar 30 '07 #2
oll3i
679 512MB
eh that was a stupid error solved it thank u
Mar 30 '07 #3

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

Similar topics

6
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email...
11
by: Steven Burn | last post by:
Just wondering if it would be possible to convert an existing e-mail form to; 1. Send the e-mail (as it does now...without problems) 2. Copy one folder on the server, to another new folder ...
5
by: bissatch | last post by:
Hi, I have just managed to install DOMXML on my apache/PHP setup. I am running PHP 4.3.0 and Apache2. $xmldoc = domxml_open_file("inc/menu.xml", DOMXML_LOAD_DONT_KEEP_BLANKS); When I try...
3
by: Nuevo Registrado | last post by:
All, I am having a tough time figuring out how to code a simple app to read an xml file and an xsd file and validate the xml file using the xsd without using a namespace for the schema. Help?...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
12
by: Jeff | last post by:
Looking for your highly subjective opinions (from those of you who have been working extensively with VS 2005). I have a client that needs/wants a complete rewrite of an existing application. I...
85
by: Russ | last post by:
Every Python programmer gets this message occasionally: IndexError: list index out of range The message tells you where the error occurred, but it doesn't tell you what the range and the...
4
by: siggi | last post by:
Hi all, newbie question: I'd like to try speech synthesis with PythonWin 2.5. Problem ****** according to several instructions, such as found on...
2
by: monsalvo | last post by:
What's so wrong with my code? This line is part of a VBScript soap client part of a DTS wich is functional in a 90 percent. strText = .responseXML.selectSingleNode("//" login "loginReturn") ...
8
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.