How to identify an instance?

In an interview I was asked a question, and I could not answer it ... Here is a question

  • How do you define an instance of [C #]?

My answer was a different name object... what is the correct answer for this question ...

+1
source share
10 answers

The instance belongs to the class, as the cake is a recipe. Each time you use the constructor to create an object, you create an instance.

+21
source

I would describe the instance as a single copy of the object. There may be one, there may be thousands, but the instance is a specific copy to which you can have a link.

+6
source

MyObject obj = new MyObject();

+4

- , - .

+4

"" - , , "", , (, : , ..) .NET(, WinForm?) .NET; Enum.

"" "", , , , / , , "". , .

- " ", " -".

+1

yup, , "" . - , .

0

, /. , .

0

...

, "" - , , , , , . , Ford Fiesta, 1.6 EXI 2009 , . , .

0

, , , #. , .

, , , . ​​

, ;

:

  • - .

  • var John = new Person();

John, Person(). Person() , , .

, " " "", INSTANCE , OOP OBJECT.

  • - .

  • int x = 5;

Everything is the same here. x is the name of a memory location that has 4 bytes of capacity for storing an integer. Another thing here is x - this is INSTANCE for int, but not for the object.

0
source

An instance is synonymous with an object, and when we create an object of a class, we say that we create an instance of the class

in a simple copy of the word means creating a link to the object (a copy of the object at a specific time) and the object is referenced to the memory address of the class

0
source

All Articles