Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package esercizio2;
- public abstract class Alfabeto {
- private int valore;
- public abstract Boolean uguale(Object x);
- public void setValore(int valore) {
- this.valore = valore;
- }
- public int getValore() {
- return valore;
- }
- }
- package esercizio2;
- public class AlfaItalia extends Alfabeto {
- private String nome;
- public AlfaItalia(int valore, String nome){
- this.nome = nome;
- setValore(valore);
- }
- @Override
- public Boolean uguale(Object x) {
- return (((AlfaItalia)x).nome).equals(this.nome) && (((Alfabeto)x).getValore()).equals(this.getValore());
- //(this.getValore()) && ((AlfaItalia)x.).equals(this.nome);
- //public Boolean uguale(Object x) {
- //return (((AlfaItalia)x).nome).equals(this.nome)) && (((Alfabeto)x).getValore()).equals(this.getValore());
- //}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement