Array : Why Animals[] animals = new Cat[5] compiles, but List Animal animals = new List Cat () does
Array : Why Animals[] animals = new Cat[5] compiles, but List Animal animals = new List Cat () does not?
To Access My Live Chat Page,
On Google, Search for "hows tech developer connect"
As promised, I'm going to share a hidden feature with you.
This is a YouTube's feature which works on Desktop.
First, Make sure the video is currently in playing mode.
After that, type the word 'awesome' on your keyboard.
Your YouTube progress bar will transform into a flashing rainbow.
A brief presentation of myself,
Hi, my name is Delphi, nice to meet you.
I am at your disposal to help you with any questions you have.
Array : Why Animals[] animals = new Cat[5] compiles, but List Animal animals = new List Cat () does not?
I am available to answer your more detailed queries via comments or chat.
Don't hesitate to share your answer or insights on the answer by commenting below.
I will express my appreciation for your answer by 'hearting' it.
Array animals () Cat Animal : new List does Cat[5] animals = new Animals[] Why List compiles, = not? but