Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Object and *?

What should be used while declaring a variable as below:

private var someVar:*;

OR

private var someVar:Object;

What is the difference between the two? What makes one superior then other in various situations? Any examples?

Thanks.

like image 546
M.D. Avatar asked Dec 03 '11 05:12

M.D.


People also ask

What is difference between object and instance?

An instance is a specific representation of an object. An object is a generic thing while an instance is a single object that has been created in memory. Usually an instance will have values assigned to it's properties that differentiates it from other instances of the type of object.

What is difference between an object and a class?

A class defines object properties including a valid range of values, and a default value. A class also describes object behavior. An object is a member or an "instance" of a class. An object has a state in which all of its properties have values that you either explicitly define or that are defined by default settings.

What is difference between class and object in C++?

A class is a template for creating objects in program whereas the object is an instance of a class. A class is a logical entity while object is a physical entity. A class does not allocate memory space on the other hand object allocates memory space.

What is difference between class and object in Python?

An object is simply a collection of data (variables) and methods (functions) that act on those data. Similarly, a class is a blueprint for that object. We can think of a class as a sketch (prototype) of a house. It contains all the details about the floors, doors, windows, etc.


1 Answers

someVar:* is a special untyped var that holds the default value undefined while

Object var default value is null.

That's the only key difference.

like image 148
Benny Avatar answered Sep 30 '22 17:09

Benny