Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package oop2016.contest1.gruppo23;
- import java.util.Objects;
- /**
- *
- * @author Francesco Avallone
- */
- public abstract class Aereomobile
- {
- private final String codice;
- private final int numeroSequenziale;
- private static int allocati;
- public Aereomobile(String codice)
- {
- this.codice=codice;
- numeroSequenziale=hashCode();
- }
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 17 * hash + Objects.hashCode(this.codice);
- return hash;
- }
- public String getCodice() {
- return codice;
- }
- public int getNumeroSequenziale() {
- return numeroSequenziale;
- }
- public static int getAllocati() {
- return allocati;
- }
- @Override
- public String toString() {
- return "Aereomobile n."+
- numeroSequenziale+" - "+
- "Codice = "+codice;//To change body of generated methods, choose Tools | Templates.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement