Article View: pl.comp.lang.java
Article #484Problem ze switch...case
From: Radoslaw Poplawski
Date: Mon, 07 Apr 1997 10:25
Date: Mon, 07 Apr 1997 10:25
18 lines
1071 bytes
1071 bytes
Przy probie kompilacji takiego fragmentu:
int numer;
switch (Zmienna_Tekstowa) {
case "Tekst.Numer.1": numer=1;break;
case "Tekst.Numer.2": numer=2;break;
};
return(numer);
kompilator wysypuje sie z komunikatem "Nie moge przekonwerowac String
do int".
Wszystkie znane mi przyklady podaja przy opisywaniu tejze instrukcji
(switch) zmienna char. Czyzby nie bylo mozna stosowac String'ow?
Radoslaw Poplawski (Wroclaw) http://yi.com/home/PoplawskiRadoslaw/
MotorCity: http://www.geocities.com/MotorCity/3416/
F1: http://www.geocities.com/MotorCity/3416/f1.html
Technical Details
Message-ID:
<334aca16.2136238@news.icm.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!not-for-mail From: radekp@usa.net (Radoslaw Poplawski) Newsgroups: pl.comp.lang.java Subject: Problem ze switch...case Date: Mon, 07 Apr 1997 10:25:35 GMT Organization: ICM Lines: 18 Message-ID: <334aca16.2136238@news.icm.edu.pl> NNTP-Posting-Host: ppp-cen18.wroclaw.tpnet.pl Mime-Version: 1.0 X-Newsreader: Forte Agent .99g/32.339 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit