45 lines
863 B
Java
45 lines
863 B
Java
public class Document {
|
|
protected String titre;
|
|
protected String ISBN;
|
|
|
|
public Document(String t, String i) {
|
|
this.titre = t;
|
|
this.ISBN = i;
|
|
}
|
|
|
|
@Override
|
|
public String toString () {
|
|
return this.titre + "(ISBN"+this.ISBN+")";
|
|
}
|
|
}
|
|
public class Periodique extends Document{
|
|
private int numero;
|
|
|
|
public Periodique(String t, String i, int n) {
|
|
super(t, i);
|
|
this.numero = n;
|
|
}
|
|
|
|
@Override
|
|
public String toString () {
|
|
return this.titre + "(numero"+this.numero+"(ISBN"this.ISBN+")";
|
|
}
|
|
}
|
|
|
|
public class Ouvrage extends Document{
|
|
private String Auteur;
|
|
|
|
public Ouvrage(String t, String t, String A) {
|
|
super(t,i);
|
|
this.Auteur=A;
|
|
}
|
|
|
|
@Override
|
|
public String toString () {
|
|
return super.toString() + " " + this.auteur;
|
|
}
|
|
}
|
|
|
|
|
|
|