Object oriented programming in c# object difination
I have an object which I defined it global, The class which I define my
object from that has a variable. The type of this variable is as same as
this class see below
"public class _car{
public _car(){}
_car BMW=null;
}
..
..
..
public _car machine =new _car()"
pay attention the last line is global definition of an object machine. my
question is if in a method which is not located in _car class do something
like this
"public another_Class(){
public another_class(){}
public void this_Methode(){
if(Machine.BMW==null)Machine.BMW=new _car();
}
" I mean I declared BMW object but My question is in all time this is
defined suppose in another time I comeback to this method Is Machin.BMW is
null or it alive for all time
No comments:
Post a Comment