codice:
package Biblioteca;
import java.util.*;
public class Biblioteca {
private ArrayList<Utente> utenti = new ArrayList<Utente>();
private ArrayList<Libro> libri = new ArrayList<Libro>();
private ArrayList<Prestito> prestiti = new ArrayList<Prestito>();
public Biblioteca(){
}
public ArrayList<Libro> inventario(Date d){
ArrayList<Libro> ret = new ArrayList<Libro>();
for(Prestito x:prestiti){
if(x.inPrestito(d))
ret.add(x.getLibro());
}
return ret;
}
public ArrayList<Libro> inPrestito(Date d, int cod){
ArrayList<Libro> ret = new ArrayList<Libro>();
for(Prestito x:prestiti){
if(x.inPrestito(d))
if(x.getUtente().getCodice()==u))
ret.add(x.getLibro());
}
return ret;
}
}
Il comando che do è: javac Biblioteca.java
risultato:
Biblioteca.java:16: error: ')' expected
if(x.inPrestito(Date d)
^
Biblioteca.java:16: error: illegal start of expression
if(x.inPrestito(Date d)
^
Biblioteca.java:16: error: ';' expected
if(x.inPrestito(Date d)
^
Biblioteca.java:23: error: ')' expected
if(x.inPrestito(Date d)
^
Biblioteca.java:23: error: illegal start of expression
if(x.inPrestito(Date d)
^
Biblioteca.java:23: error: ';' expected
if(x.inPrestito(Date d)
^
Biblioteca.java:24: error: not a statement
if(x.getUtente().equals(u))
^
Biblioteca.java:24: error: ';' expected
if(x.getUtente().equals(u))
^
8 errors