my understanding is that primitive types (uint, string, Number, etc.) of a class do not need to be set to null for garbage collection.
for example, i am not required to write this dispose()
method in the following class:
package{//Importsimport flash.display.Shape;//Classpublic class DrawSquare extends Shape { //Properties private var squareColorProperty:uint; //Constructor public function DrawSquare(squareColor:uint) { squareColorProperty = squareColor; init(); } //Initialize private function init():void { graphics.beginFill(shapeColorProperty); graphics.drawRect(0, 0, 200, 200); graphics.endFill(); } //Dispose public function dispose():void { squareColorProperty = null; } //Get Shape Color public function get squareColor():uint; { return squareColorProperty; } }}
if this is true, which i believe it is, what is the difference between objects of primitive types and objects of non primitive types concerning memory allocation?