Post Reply 
Instantiating an Array of Custom Class
Author Message
Slushba132
BustyLoli-Chan

Posts: 3,125.3993
Threads: 508
Joined: 20th Feb 2008
Reputation: -8.27558
E-Pigs: 73.1299
Offline
Post: #1
Instantiating an Array of Custom Class
So today I learned that when you instantiate an array of a custom class (in C# and Java)

Code:
customClass[] customClasses = new CustomClass[4];


you actually create an array of null references to this class. The class doesn't automatically initialize. And personally, I think THAT IS SO DAMN DUMB...
WHO THE FUCK NEEDS AN ARRAY OF NULL REFERENCES
WHY DON'T THEY JUST AUTO INSTANTIATE?

When I found out Java did this I almost slapped a bitch, but then I tested it in C# an the exact same thing happens...
I guess I've always taken the ArrayList for granted since it actually automatically instantiates your classes for you. Unfortunately, the ArrayList is not allowed on this assignment.


10/09/2012 04:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Instantiating an Array of Custom Class - Slushba132 - 10/09/2012 04:09 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: