ActionScript 3.0 Object class Quiz

Check following code ::

var obj1:Object = new Object();
obj1.prop1 = “Naresh”;
obj1.prop2 = “Khokhaneshiya”;
var obj2:Object = new Object();
obj2.prop2 = “Hello world”;
obj1 = obj2;
trace(obj1.prop1);
//What will be output here
obj1.prop1 = “Khokhaneshiya”;
trace(obj1.prop1);
//What will be output here

Be honest, Don’t trace it out using Flash.

You will have answer in following posts !

2 Responses to this post.

  1. Posted by sawrub on September 8, 2009 at 1:34 pm

    any idea why I get a Syntax error at obj1.prop1 = “Naresh”; itself?

    Reply

Respond to this post