C# Questions Answers-C# structure (PartI)


C# structure (PartI)

1. Which of the following statements about the structure is not true?
a. To use a structure, previously it is defined.
b. A structure can have different types of variables in it.
c. A structure can't have its own constructor.
Check answer 2. A constructor of structure is used to initialize the variables of the structure.
a. True   b. False Check answer 3. The new keyword can be used to create an object of a structure.
a. True   b. False Check answer 4. A constructor of structure can have different name from the structure.
a. True   b. False Check answer 5. Which of the following statements about accessing the variables of structure is not true?
structure Employee{
    public string emp_id;
    public string emp_name;
    public string emp_sex;
}
Employee emp;
a. emp.emp_id;
b. emp->emp_name;
Check answer 6. Which of the following statements about creating an array (size 20) of structures are not true?
structure Employee{
    public string emp_id;
    public string emp_name;
    public string emp_sex;
}
a. Employee emp[20];
b. Employee[20] emp;
c. Empoyee[] emp=new Employee[20]; Check answer


Comments




This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.