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 are the two uses of a ‘using’ statement in c#?
what is scope of a protected internal member variable of a c# class
What is gac? How to put assembly in gac?
Describe an interface class?
How will you deploy the dll file in gac?
What are the properties of string?
Can you access a hidden base class method in the derived class?
Explain About remoting and web services. Difference between them
Is unboxing an implicit conversion?
What to implement on my class Finalize or IDisposable
Is c# code is unmanaged or managed code?
What is the difference between dll and lib?
What do you know about device context?
What is jagged array in c#?
Distinguish between continue and break statement?