Advertisement
aveenger17

Elemento

Feb 27th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. class Elemento {
  2.     String nombre;
  3.     int valor;
  4.     int peso;
  5.     Elemento(String n, int v, int p) {
  6.         nombre=n;
  7.         valor =v;
  8.         peso  =p;
  9.     }
  10.     public String toString() {
  11.         return String.format("%-15s Ganancia: %,d        Peso: %,d", nombre, valor, peso);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement