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 string pool in c#?
How to use session under class file of APP_Code folder?
Why do we need serialization?
Explain the Usage of web.config
What is the CTS, and how does it relate to the CLS?
Explain the process of abstraction with an example?
Can you instantiate an abstract class c#?
What is sqladapter c#?
What's the difference between the debug class and trace class? Documentation looks the same.
Explain the difference between passing parameters by value and passing parameters by reference with an example?
How Is The Dll Hell Problem Solved In .net?
What is deadly diamond problem?
What is private virtual in C#?
Can we set image Source dynamically using C# in WPF application?
Difference between value and reference type.