MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your C Sharp Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If a class named csharp is present in namespace n1 as well as in namespace n2,then which of the following is the correct way to use csharp class? |
| A. | a |
| B. | b |
| C. | c |
| D. | d |
| Answer» D. d | |
| 2. |
Which of the following statements are correct about a namespace used in C#.NET?1. Classes must belong to a namespace, whereas structures need not.2. Every class, struct, enum, delegate and interlace has to belong to some or the other namespace.3. All elements of the namespace have to belong to one file.4. If not mentioned, a namespace takes the name of the current project.5. The namespace should be imported to be able to use the elements in it. |
| A. | 1, 3 |
| B. | 2, 4, 5 |
| C. | 3, 5 |
| D. | 4 only |
| Answer» C. 3, 5 | |
| 3. |
Which among the given is not a correct way to call the method Issue() defined in the code snippet given below? |
| A. | College.Lib.Book b = new College.Lib.Book();b.issue(); |
| B. | Book b = new Book();b.issue(); |
| C. | using College.Lib;Book b = new Book();b.issue(); |
| D. | All of the mentioned |
| Answer» C. using College.Lib;Book b = new Book();b.issue(); | |
| 4. |
What will be the output of the following code snippet? |
| A. | DEBUG is definedDEBUG and MYTEST are not defined |
| B. | DEBUG and MYTEST are not defined |
| C. | MYTEST is definedDEBUG and MYTEST are not defined |
| D. | DEBUG is defined |
| Answer» C. MYTEST is definedDEBUG and MYTEST are not defined | |
| 5. |
Which among the following is the correct statement about the using statement used in C#.NET? |
| A. | A C#.NET source code file consists of any number of using statement |
| B. | By using ‘using’ statement it’s possible to create an alias for the namespace but not for the namespace element |
| C. | It is permitted to define a member at namespace level using alias |
| D. | Using statement can be placed anywhere in the C#.NET source code file |
| Answer» D. Using statement can be placed anywhere in the C#.NET source code file | |
| 6. |
Which of the followings are NOT a .NET namespace?1. System.Web2. System.Process3. System.Data4. System.Drawing2D5. System.Drawing3D |
| A. | 1, 3 |
| B. | 2, 4, 5 |
| C. | 3, 5 |
| D. | 1, 2, 3 |
| Answer» C. 3, 5 | |