خرید بک لینک

Vote count: 0

I have this assignment where I'm supposed to use a custom array list. I am quite confused about lists and generics. In the template for our code we're given "private myObj[] objects;", which is from the class myObj.java which only contains attribute of type T called "data". "private myObj[] objects;" looks a lot like an array to me. I thought generics didn't get along with arrays. I tried casting to be able to create enough "space" for 10 elements of type T(generic), but I couldn't do this without compiler errors which only go away when I comment out the casting of an array of type myObj of size 10 as "myObj[]". Help me please. My TA's have not answered my questions.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 5 ارديبهشت 1395 ساعت: 9:25

صفحه بندی