Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-15-2009, 09:19 PM   #1
Solid State Member
 
Join Date: Nov 2008
Posts: 6
Default instantiation

Code:
class MyProgram
{
    static void Main()
    {
        int[] integers;            // declare array
        integers = new int[10];    // size array
    }
}
In which line is the array actually instantiated?
__________________

BioHazard90 is offline   Reply With Quote
Old 01-15-2009, 09:39 PM   #2
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: instantiation

I would say line "//size array"
__________________

JogaBonito1502 is offline   Reply With Quote
Old 01-20-2009, 11:43 AM   #3
In Runtime
 
Daeva's Avatar
 
Join Date: Dec 2005
Posts: 407
Send a message via AIM to Daeva Send a message via MSN to Daeva Send a message via Yahoo to Daeva
Default Re: instantiation

I would agree, The first line simply tells the computer that memory is going to be used, but the second line is where memory is allocated for the variable and given a pointer reference.
__________________
**Official Self-proclaimed glorified excessive (insert additional adjectives here) post editor/modifier.
Edit = Best feature ever
http://www.twitter.com/xDaevax
Daeva is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 02:51 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0