

McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Computer Science Engineering (CSE) , Information Technology Engineering (IT) , Master of Computer Applications (MCA) , Programming Languages .
Chapters
1. |
Which of the following statements are correct about data types?
|
A. | 1,3,5 |
B. | 2,4 |
C. | 3,5 |
D. | 1,2,5 |
Answer» D. 1,2,5 |
2. |
Which of the following is NOT an Integer? |
A. | Char |
B. | Byte |
C. | Integer |
D. | Long |
Answer» A. Char |
3. |
What will be the output of the following code snippet when it is executed?
|
A. | 0.1 |
B. | 1.0 |
C. | 1.1 |
D. | 11 |
Answer» A. 0.1 |
4. |
Which of the following is the correct size of a Decimal datatype? |
A. | 8 bytes |
B. | 4 bytes |
C. | 10 bytes |
D. | None of the above |
Answer» D. None of the above |
5. |
Which of the following statements are correct?
|
A. | 2,5 |
B. | 1,5 |
C. | 3,4 |
D. | 2,3 |
Answer» B. 1,5 |
6. |
Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified? |
A. | float pi = 3.14F; |
B. | #define pi 3.14F; |
C. | const float pi = 3.14F; |
D. | const float pi; pi = 3.14F; |
Answer» C. const float pi = 3.14F; |
7. |
Which of the following can be used to terminate a while loop and transfer control outside the loop?
|
A. | 1,3 |
B. | 2,4 |
C. | 3,5 |
D. | 4,5 |
Answer» D. 4,5 |
8. |
Which of the following statements are correct about the C#.NET
|
A. | 1,3 |
B. | 2,5 |
C. | 1,4,5, |
D. | 3,4,5 |
Answer» C. 1,4,5, |
9. |
Which of the following is the correct output for the C#.NET code snippet given below? Console.WriteLine(13 / 2 + " " + 13 % 2); |
A. | 6.5 1 |
B. | 6.5 0 |
C. | 6 0 |
D. | 6 1 |
Answer» D. 6 1 |
10. |
Which of the following statements are correct?
|
A. | 1,3,5 |
B. | 2,4 |
C. | 3,5 |
D. | 2,4,5 |
Answer» A. 1,3,5 |
11. |
Which of the following is the correct way to create an object of the class Sample?
|
A. | 1,3 |
B. | 2,4 |
C. | 1,2,3 |
D. | 4,5 |
Answer» A. 1,3 |
12. |
Which of the following statements is correct about constructors? |
A. | If we provide a one-argument constructor then the compiler still provides a zeroargument constructor. |
B. | Overloaded constructors have the same name as the class name |
C. | Overloaded constructors cannot use optional arguments. |
D. | If we do not provide a constructor, then the compiler provides a zero-argument constructor. |
Answer» D. If we do not provide a constructor, then the compiler provides a zero-argument constructor. |
13. |
Which of the following statements is correct? |
A. | There is one garbage collector per program running in memory. |
B. | There is one common garbage collector for all programs. |
C. | An object is destroyed by the garbage collector when only one reference refers to it. |
D. | We have to specifically run the garbage collector after executing Visual Studio.NET. |
Answer» B. There is one common garbage collector for all programs. |
14. |
Which of the following can be facilitated by the Inheritance mechanism?
|
A. | 1,2,3 |
B. | 3,4 |
C. | 2,4,5 |
D. | 3,5 |
Answer» A. 1,2,3 |
15. |
Which one of the following statements is correct? |
A. | Array elements can be of integer type only. |
B. | The rank of an Array is the total number of elements it can contain. |
C. | The length of an Array is the number of dimensions in the Array. |
D. | The default value of numeric array elements is zero. |
Answer» D. The default value of numeric array elements is zero. |
16. |
Which of the following statements are correct about arrays used in C#.NET?
|
A. | 1,2 |
B. | 1,3,5 |
C. | 3,4 |
D. | 1,2,5 |
Answer» D. 1,2,5 |
17. |
Which of the following statements are correct?
|
A. | 1,2 |
B. | 3,4 |
C. | 1,2,4 |
D. | 3,5 |
Answer» A. 1,2 |
18. |
Which of the following will be the correct output for the C#.NET code snippet given below?
|
A. | ARE |
B. | CRE |
C. | CR |
D. | REA |
Answer» B. CRE |
19. |
If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references? |
A. | s1 is s2 |
B. | s1=s2 |
C. | s1==s2 |
D. | s1.Equals(s2) |
Answer» D. s1.Equals(s2) |
20. |
Which of the following statements is correct about an Exception? |
A. | It occurs during compilation. |
B. | It occurs during linking. |
C. | It occurs at run-time. |
D. | It occurs during Just-In-Time compilation. |
Answer» C. It occurs at run-time. |
21. |
Which of the following statements are correct about exception handling in C#.NET?
|
A. | 1 only |
B. | 2 only |
C. | 2 and 5 only |
D. | 3 and 4 only |
Answer» C. 2 and 5 only |
22. |
______ parameters are used to pass results back to the calling method. |
A. | Input |
B. | Reference |
C. | Value |
D. | Output |
Answer» D. Output |
23. |
The formal-parameter-list is always enclosed in _______. |
A. | Square |
B. | Semicolon |
C. | Parenthesis |
D. | Colon |
Answer» C. Parenthesis |
24. |
_______ variables are visible only in the block they are declared. |
A. | System |
B. | Global |
C. | Local |
D. | Console |
Answer» C. Local |
25. |
C# does not support _____ constructors. |
A. | parameterized |
B. | parameter-less |
C. | Class |
D. | Method |
Answer» B. parameter-less |
26. |
A structure in C# provides a unique way of packing together data of ______ types. |
A. | Different |
B. | Same |
C. | Invoking |
D. | Calling |
Answer» A. Different |
27. |
Struct’s data members are ____________ by default. |
A. | Protected |
B. | Public |
C. | Private |
D. | Default |
Answer» C. Private |
28. |
A _______ creates an object by copying variables from another object. |
A. | Copy constructor |
B. | Default constructor |
C. | Invoking constructor |
D. | Calling constructor |
Answer» A. Copy constructor |
29. |
The methods that have the same name, but different parameter lists and different definitions is called______. |
A. | Method Overloading |
B. | Method Overriding |
C. | Method Overwriting |
D. | Method Overreading |
Answer» A. Method Overloading |
30. |
The C# provides special methods known as _____ methods to provide access to data members. |
A. | Loop |
B. | Functions |
C. | Methods |
D. | Accessor |
Answer» D. Accessor |
31. |
Storage location used by computer memory to store data for usage by an application is ? |
A. | Pointers |
B. | Constants |
C. | Variable |
D. | None of the mentioned |
Answer» C. Variable |
32. |
Which of these can be overloaded? |
A. | Constructors |
B. | Methods |
C. | Both a & b |
D. | None of the mentioned |
Answer» C. Both a & b |
33. |
Number of constructors a class can define of ? |
A. | 1 |
B. | 2 |
C. | Any number |
D. | None of the mentioned |
Answer» C. Any number |
34. |
Correct statement about constructors in C#.NET is ? |
A. | Constructor cannot be overloaded |
B. | Constructor allocate space for object in memory |
C. | Constructor are never called explicitly |
D. | Constructor have same name as name of the class |
Answer» D. Constructor have same name as name of the class |
35. |
Constructors are used to |
A. | initialize the objects |
B. | construct the data members |
C. | both a & b |
D. | None of the mentioned |
Answer» C. both a & b |
36. |
To overload a method which of the following statement is false? |
A. | If the return type is different methods are overloaded |
B. | Name of the overloaded method should be same |
C. | Type of the parameter should be different |
D. | Order of the parameter should be different if types are same |
Answer» A. If the return type is different methods are overloaded |
37. |
Which of the following statements is correct about constructors in C#.NET? |
A. | A constructor cannot be declared as private |
B. | A constructor cannot be overloaded |
C. | A constructor can be a static constructor |
D. | None of the mentioned |
Answer» D. None of the mentioned |
38. |
What is return type of constructors? |
A. | int |
B. | float |
C. | void |
D. | None of the mentioned |
Answer» D. None of the mentioned |
39. |
Which method have same name as that of its class? |
A. | delete |
B. | class |
C. | constructor |
D. | None of mentioned |
Answer» C. constructor |
40. |
Which of following statement are correct about functions? |
A. | C# allows a function to have arguments with default values |
B. | Redefining a method parameter in the method’s body causes an exception |
C. | C# allows function to have arguments of private type |
D. | Omitting the return type in method definition results into exception |
Answer» A. C# allows a function to have arguments with default values |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.