Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I have a class declared as below
public class a
{
public void add()
{}
}



What is the diference between
a a1 =new a;
and simply
a a1;

Answers were Sorted based on User's Feedback



I have a class declared as below public class a { public void add() {} } What is th..

Answer / rahul maurya

in a a1=new a memory is allocated to the main function to execute

Is This Answer Correct ?    8 Yes 0 No

I have a class declared as below public class a { public void add() {} } What is th..

Answer / radhika

a a1;
At this stage, a1 is of type a, but it does not actually
contain the object data yet. For it to
contain the object data, you need to use the new keyword to
create a new instance of the a class,this
process is known as object instantiation :
a a1 = new a();

Is This Answer Correct ?    3 Yes 0 No

I have a class declared as below public class a { public void add() {} } What is th..

Answer / pritam kumar

in a a1
It only declares an object a1 of class a but no memory is
allocted to execute the main method

where as in a a1 = new a

It declares an object and also intiate it using the new key
word.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

what is the scope of anonymous type ?

0 Answers   Wipro,


What are the examples of data types?

0 Answers  


Explain the difference between pass by value and pass by reference.

0 Answers   TCS,


What is namespace explain with example?

0 Answers  


What is class method c#?

0 Answers  


What is ienumerable t in c#?

0 Answers  


What are the types of inheritance in c#?

0 Answers  


What is a datacontract?

0 Answers  


What is serialization in .net?

0 Answers  


What is a static in c#?

0 Answers  


What is the name of the implicit input parameter of a set accessor for any property?

1 Answers   TCS,


Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?

0 Answers   Siebel,


Categories