What is the difference between flex – var t: myclass = myclass (o); and var t: myclass = o acts as Myclass;

What is the difference between this type of conversion expression? What is better?

// One way
var t:MyClass = MyClass(o);
// Another
var t:MyClass = o as MyClass;

Oh, I knew that one before…

Ok, if it cannot be converted to MyClass, the first one will fail, i.e. you will end up with an exception flying your stack.

The second one will never be thrown if If you can’t perform proper projection, you will only end up with a null value.

I think.

What is the difference between this type of conversion expression? ? What is better?

// One way
var t:MyClass = MyClass(o);
// Another
var t:MyClass = o as MyClass;

Oh, I knew that one before…

Ok, if it can’t be converted to MyClass, the first one will fail, i.e. you will end up with an exception flying your stack.

The second one will never be thrown, if you can’t cast properly, you will only end up with one Null value.

I think.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5844 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.