Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Programmazione > [Capra] Progetto
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
johnnyd
.grande:maestro.

User info:
Registered: Sep 2005
Posts: 840 (0.12 al dì)
Location: Milano (Fragagnano)
Corso: Informatica
Anno: IV
Time Online: 13 Days, 22:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Capra] Progetto

code:
public Carta (String simbolo, String colore) { boolean trovato = false; for (String s : simboli) if (s.equalsIgnoreCase(simbolo)) { trovato = true; break; } if (trovato) { trovato = false; for (String s : colori) if (s.equalsIgnoreCase(colore)) { trovato = true; break; } } if (!trovato) throw new IllegalArgumentException(); //colore e simbolo sono tra quelli ammessi this.simbolo = simbolo; this.colore = colore; }

questo è un pezzo di codice che il professor capra ha inserito nell'esercizio.. mi da problemi eclipse sulla compilazione del for each.. come risolvo sta cosa?

__________________
My Blog - My Photo Album

12-04-2006 11:37
Click Here to See the Profile for johnnyd Click Here to See the Blog of johnnyd Click here to Send johnnyd a Private Message Find more posts by johnnyd Add johnnyd to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
imperator
.consigliere.

User info:
Registered: Apr 2004
Posts: 146 (0.02 al dì)
Location:
Corso:
Anno:
Time Online: 5 Days, 6:58:26 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ho dato un'occhiata al testo del prof Capra...
lui ha creato semplicemente degli array di tipo riferimento a oggetti String...
Ora, il ciclo for-each lo posso usare su qualcosa che implementa l'interfaccia Iterable.
La classe String se non erro non implementa Iterable e dunque non posso usare il ciclo for-each.
Per poterlo usare avrei dovuto ad esempio creare una sequenza di oggetti di tipo String (usando la classe Sequenza del Pighizzi, che implementa Iterable).
Cmq è meglio che chiedi delucidazioni al prof, perchè è piu probabile che sbagli io.

Last edited by imperator on 12-04-2006 at 13:42

12-04-2006 13:27
Click Here to See the Profile for imperator Click here to Send imperator a Private Message Find more posts by imperator Add imperator to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
johnnyd
.grande:maestro.

User info:
Registered: Sep 2005
Posts: 840 (0.12 al dì)
Location: Milano (Fragagnano)
Corso: Informatica
Anno: IV
Time Online: 13 Days, 22:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma caprann risponde alle email?
nn posso andare a ricevimento xkè sono a taranto :(

__________________
My Blog - My Photo Album

13-04-2006 13:55
Click Here to See the Profile for johnnyd Click Here to See the Blog of johnnyd Click here to Send johnnyd a Private Message Find more posts by johnnyd Add johnnyd to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
imperator
.consigliere.

User info:
Registered: Apr 2004
Posts: 146 (0.02 al dì)
Location:
Corso:
Anno:
Time Online: 5 Days, 6:58:26 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Di solito si, ma non immediatamente

13-04-2006 15:50
Click Here to See the Profile for imperator Click here to Send imperator a Private Message Find more posts by imperator Add imperator to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
johnnyd
.grande:maestro.

User info:
Registered: Sep 2005
Posts: 840 (0.12 al dì)
Location: Milano (Fragagnano)
Corso: Informatica
Anno: IV
Time Online: 13 Days, 22:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ha detto che si può usare solo con la 1.5 ... e io credo di avere installato la jdk 1.5 :S

__________________
My Blog - My Photo Album

14-04-2006 13:36
Click Here to See the Profile for johnnyd Click Here to See the Blog of johnnyd Click here to Send johnnyd a Private Message Find more posts by johnnyd Add johnnyd to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
CirAnto
.amico.

User info:
Registered: Jul 2003
Posts: 25 (0.00 al dì)
Location:
Corso:
Anno:
Time Online: 10:30:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ho la 1.5.06 e non ho problemi di compilazione....

Aggiungo una domanda semplice semplice: ma per l'implementazione del progetto l'utilizzo del package prog.utili (non "io" come è erronenamente riportato sul testo) è consentito?

Devo ricodificare una classe "Sequenza" che implementa l'interfaccia Iterable?
Esiste in giro il sorgente della classe Sequenza?

Grassie :)

15-04-2006 20:24
Click Here to See the Profile for CirAnto Click here to Send CirAnto a Private Message Find more posts by CirAnto Add CirAnto to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
johnnyd
.grande:maestro.

User info:
Registered: Sep 2005
Posts: 840 (0.12 al dì)
Location: Milano (Fragagnano)
Corso: Informatica
Anno: IV
Time Online: 13 Days, 22:13:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

io ci ho rinunciato... mi faccio sto benedetto orale e me lo tolgo davanti :D

__________________
My Blog - My Photo Album

17-04-2006 11:55
Click Here to See the Profile for johnnyd Click Here to See the Blog of johnnyd Click here to Send johnnyd a Private Message Find more posts by johnnyd Add johnnyd to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 23:18.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.037 seconds (74.60% PHP - 25.40% MySQL) con 28 query.