C# Programming - Structures
Exercise : Structures - General Questions
- Structures - General Questions
6.
Which of the following statements is correct about the C#.NET code snippet given below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample ss = new Sample();
7.
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();
8.
Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?
struct Address
{
private int plotno;
private String city;
}
Address a = new Address();
Address b;
b = a;
9.
Which of the following statements are correct?
- A struct can contain properties.
- A struct can contain constructors.
- A struct can contain protected data members.
- A struct cannot contain methods.
- A struct cannot contain constants.
10.
C#.NET structures are always value types.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers