Which of the following is the correct result for the given statement in the C#.NET statement given below?
p = q
struct employee
{
private int employee id;
private string city;
}
employee q = new employee();
employee p;
p = q;
struct employee
{
private int employee id;
private string city;
}
employee q = new employee();
employee p;
p = q;A. Elements of 'q' will be copied into corresponding elements of p
B. Address stored in q will get copied into p
C. Address of first element of q will get copied into p
D. Once assignment is over. q will go out of scope and hence get exited forever
Answer: Option A
Related Questions on Classes and Objects in C Sharp
A. A blueprint for creating objects
B. A method in C#
C. A variable in C#
D. A data type in C#
A. A method in C#
B. A variable in C#
C. An instance of a class
D. A data type in C#
A. public
B. private
C. protected
D. internal

Join The Discussion