fork(1) download
  1. import java.util.*;
  2.  
  3. class Main {
  4. public static void main (String[] args) {
  5. Map<String, Alimento> mapalimentos = new HashMap<>();
  6. mapalimentos.put("Maçã", new Alimento(50, 10));
  7. mapalimentos.put("Melancia", new Alimento(30, 20));
  8. }
  9. }
  10.  
  11. class Alimento {
  12. public Alimento(int calorias, int proteinas) {
  13. Calorias = calorias;
  14. Proteinas = proteinas;
  15. }
  16. int Calorias;
  17. int Proteinas;
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/257120/101
Success #stdin #stdout 0.06s 32288KB
stdin
Standard input is empty
stdout
Standard output is empty