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;
Answer Posted / 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 View All Answers
What is the use of delegates in c#?
Is int a struct in c#?
What is thread life cycle in c#?
What is a value type in c#?
How do I unload an assembly?
What are the characteristics of c#?
What is parsing? How to parse a date time string?
What is tryparse c#?
Why do we need constructor?
To allow an element to be accessed using a unique key which .NET collection class is used ?
What is the use of ienumerable in c#?
Can we use "this" command within a static method?
Does c# support properties of array types?
What is gui in c#?
What does a constructor do c#?