admin wrote: ↑Tue Aug 28, 2018 6:58 am
After reading your post, I am not sure if I understand your original issue. I am not sure if you understand the difference between ArrayList<Object> and ArrayList. Further, when you say, "So casting can't be used in Lambdas", it seems like you are not clear on the syntax of lambda expression. You can certainly use casting inside a lambda expression but what you are trying to do with ((String) x) doesn't make any sense. You might want to read up on its syntax from a book.
Yes, I'm here to learn. Let's see if I can figure it out starting from your answer:
1 - ArrayList has Object as type like ArrayList<Object>, but it seems they are two different classes. I can't find any documentation about a non generic ArrayList class, can you point me in the right direction please?
2 - Maybe I see my error... the left part of Lambdas is parameters declaration, so if I write ((String) x) I'm casting x to String, but x isn't declared. Am I right? Maybe I can use casting in the right part of Lambdas, do you mean that?
Thank you for your help, I'm reading a lot of books and using Enthuware to prepare for OCA, it's tough