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