Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
package me.parzibyte.sistemaventasspringboot;
public class ProductoParaVender extends Producto {
private Float cantidad;
public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Integer id, Float cantidad) {
super(nombre, codigo, precio, existencia, id);
this.cantidad = cantidad;
}
public ProductoParaVender(String nombre, String codigo, Float precio, Float existencia, Float cantidad) {
super(nombre, codigo, precio, existencia);
this.cantidad = cantidad;
}
public void aumentarCantidad() {
this.cantidad++;
}
public Float getCantidad() {
return cantidad;
}
public Float getTotal() {
return this.getPrecio() * this.cantidad;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment