-
-
public class Kwiaciarnia {
-
Cennik c= Cennik.getInstance();
-
-
public Kwiaciarnia(){}
-
c.setCennik("Roza Czerwona",5.0);
-
c.setCennik("Roza Biala",5.0);
-
c.setCennik("Roza Zolta",5.0);
-
c.setCennik("Roza Czarna",10.0);
-
}
-
-
-
-
-
-
public class Cennik {
-
private static Cennik instance = null;
-
Map<String,Double> cennik = new HashMap<String,Double> ();
-
-
private Cennik() { // prywatny konstruktor
-
}
-
-
public static Cennik getInstance() {
-
if(instance == null) {
-
instance = new Cennik();
-
-
}
-
return instance;
-
}
-
-
public void setCennik(String nazwaKwiat,double cena){
-
cennik.put(nazwaKwiat,cena);
-
}
-
}
-
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
2 1279 -
-
public class Kwiaciarnia {
-
Cennik c= Cennik.getInstance();
-
-
public Kwiaciarnia(){}
-
c.setCennik("Roza Czerwona",5.0);
-
c.setCennik("Roza Biala",5.0);
-
c.setCennik("Roza Zolta",5.0);
-
c.setCennik("Roza Czarna",10.0);
-
}
-
-
-
-
-
-
-
public class Cennik {
-
private static Cennik instance = null;
-
Map<String,Double> cennik = new HashMap<String,Double> ();
-
-
private Cennik() { // prywatny konstruktor
-
}
-
-
public static Cennik getInstance() {
-
if(instance == null) {
-
instance = new Cennik();
-
-
}
-
return instance;
-
}
-
-
public void setCennik(String nazwaKwiat,double cena){
-
cennik.put(nazwaKwiat,cena);
-
}
-
}
-
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.
eh that was a stupid error solved it thank u
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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
...
|
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...
|
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?...
|
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...
|
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...
|
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...
|
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...
|
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")
...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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,...
| |