Building house = new Building();
Quote:This declaration performs three functions. First, it declares a variable called house of the class type Building. This variable is not, itself, an object. Instead, it is simply a variable that can refer to an object.
Quote:his is easy to understand if you look at an example. For example, suppose you have a class House. Your own house is an object and is an instance of class House. Your sister's house is another object (another instance of class House
// Class House describes what a house is class House { // ... } // You can use class House to create objects (instances of class House) House myHouse = new House(); House sistersHouse = new House();
Variable
type
object
int i; // i is a variable name for the value type int
MyClass objMyClass ; //objMyClass is an object(variable name) of type MyClass which is a reference type
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)