2
I know a bit of java, but now I’m venturing into C#, but a question came up here: In java we instantiated an Arraylist like this:
ArrayList<Tipo> nomeArray = new ArrayList<>();
We recover a value like this:
nomeArray.get(1).getNome();
And from my test here with C#, it seems like an instance:
ArrayList nomeArray = new ArrayList();//Não declara o tipo, estranho
And it seems to recover like this:
((Tipo) nomeArray[1]).Nome;//Toda vez que tenho que recuperar tenho que usar um TypeCast?
Is this the right way? Or is there a better way?