Jump to content

Recommended Posts

Posted

A ideia é fazer o construtor das partes,

    public Carteira(String nome,HashSet<Titulo> titulos,int totCom, int totVen, double totCCom, double totCVen ){

        titular = nome;

        totalCompras = totCom;

        totalVendas = totVen;

        totalComCompra = totCCom;

        totalComVenda = totCVen;

        lstCarteira = new TreeMap<String,Titulos>();

A ideia é por dentro do treeMap na Key o valor dado "nome" e no valor o hashset<Titulo>

Deveria ficar alguma coisa do genero TreeMap<nome,titulos> onde titulos é um hashSet de titulo.

É possivel fazer isto?

       

    }

Posted

Ja tentei fazer assim mas esta a dar-me o seguinte erro:

"cannot find symbol - method put(java.lang.String,java.util.HasSet<Titulo>)"

e tenho os seguintes import's:

import java.util.TreeSet;

import java.util.TreeMap;

import java.util.HashSet;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.