Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //archivo Pelicula.java
- package Paquete;
- public class Pelicula {
- private static int proxId = 0;
- private final int id;
- private String nombre;
- private Categoria genero;
- public Pelicula() {
- super();
- proxId = proxId + 1;
- id = proxId;
- nombre = "Sin definir";
- Categoria gen = new Categoria("Sin definir");
- genero = gen;
- }
- public Pelicula(String nombre, String genero) {
- super();
- proxId = proxId + 1;
- id = proxId;
- this.nombre = nombre;
- Categoria gen = new Categoria(genero);
- this.genero = gen;
- }
- public String getNombre() {
- return nombre;
- }
- public void setNombre(String nombre) {
- this.nombre = nombre;
- }
- public int getId() {
- return id;
- }
- public static int getProxId() {
- return (proxId + 1);
- }
- public String toString() {
- return nombre + " (" + genero.toString() + ")";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement