How does instantiation work in this code:
// decleration
dataType[] arrayRefVar;
//instantiation - is it required?
arrayRefVar = new dataType[arraySize]; //A
arrayRefVar[0]=1; //B
arrayRefVar[1]=2;
I am from a C++ background, so i don't really understand creation of objects/arrays with 'new'. I know it is for allocating memory to the array and returning reference. Will the creation of array take place automatically at B if line A is skipped?
Edit: Found a similar one, if anyone interested: Array initialization syntax when not in a declaration