C Sharp # Solved MCQ 2020-21
BCA 5 semester | HNBGU
Read Also:
-
How many Bytes are stored by "Long' Deta type in C# .net ?
- 4
- 2
- 1
-
Correct Declaration of Values to variables 'a' and 'b':
- int a = 32, b 40.6;
- int a = 42, b= 40;
- int a = b=42;
-
Which data type should be more preferred for storing a simple number like 35 to improve execution speed of a program ?
- short
- int
- long
-
Default type of number without decimal is:
- long int
- unsigned long
- unsigned int
-
Valid size of float data type is :
- 10 Bytes
- 6 Bytes
- 8 Bytes
-
The Default value of Boolean Data Type is :
- 0
- True
- 1
-
Storage location used by computer memory to store data for usage by an application is :
- Pointers
- Constants
- None of the above
-
What will be the output of the following C# code ? int a, b; a = (b = 10) + 5;
- b= 10, a = 5
- b= 15, a =5
- a = 10, b=10
-
Correct order of priorities are :
- "> %' > *'>+
- ***> /* > %'> +'
- %'>**>" > +
-
The correct way of incrementing the operators are :
- ++a++
- b++1
- d=+1
-
What is the advantage of using 2D jagged array over 2D rectangular array ?
- Easy initialization of elements
- Both of the above
- None of the above
-
What will be the output of the following C# code ?
static void main (string[] args) int i = 0; while (i++!=0); Console.WriteLine(i); Console.ReadLine( );
- -127 to +127
- 0 to 127
- Infinite loop condition
-
Which of the following is a contextual keyword in C# ?
- get
- set
- add
-
Which of the following converts a type to a single Unicode character, where possible in C# ?
- ToSingle
- ToByte
- ToDateTime
-
Which of the following property of array class in C# checks whether the array is read-only ?
- IsFixedSize
- Length
- None of the above
-
Which of the following is true about exceptions in C#?
- The exception classes in C# are mainly directly indirectly or derived from the System.Exception class.
- C# exceptions are represented by classes.
- None of the above
-
Which of the following is used to define the member of a class externally ?
- :
- #
- None of the above
-
The operator used to access member function of a class ?
- :
- ::
- #
-
What is the most specified using class declaration ?
- type
- scope
- None of the above
-
Which of the following statements about objects in "C#" is correct ?
- Everything you use in C# is an object, including Windows Forms and controls.
- Objects have methods and events that allow them to perform actions.
- All objects created from a class will occupy equal number of bytes in memory.
-
The data members of a class by default are :
- public, protected
- private, public
- public
-
The number of levels of inheritance are :
- 5
- 3
- 2
-
Which procedure among the following should be used to implement a 'Has a' or a 'Kind of relationship between two entities ?
- Polymorphism
- Templates
- All of the above
-
Select the class visibility modifiers among the following:
- Private, protected, public, internal
- Private, protected, public
- All of the above
-
In Inheritance concept, which of the following members of base class are accessible to derived class members ?
- Static
- Private
- Shared
-
Which of the following functionality is facilitated by inheritance mechanism ?
- Use the existing functionality of base class
- Override the existing functionality of base class
- Implements new functionality in derived class
-
If no access modifier for a class is specified, then class accessibility is defined as :
- Public
- Protected
- Internal
-
What will be the output of the following C# code ? static void Main(string[ ] args) String name "Dr. Gupta"; Console. WriteLine ("Good Morning"+ name);'
- Dr. Gupta
- Good Morning
- Good Morning name
-
Storage location used by computer memory to store data for usage by an application is:
- Constants
- Pointers
- None of the above
-
Which of the following statements about objects in "C#" is correct ?
- Everything you use in C# is an object, including Windows Forms and controls.
- Objects have methods and events that allow them to perform actions.
- All objects created from a class will occupy equal number of bytes in memory.
-
The capability of an object in C# to take number of different forms and hence display behaviour as according is known as :
- Encapsulation
- Abstraction
- None of the above
-
Correct way to overload + operator:
- public sample operator + (sample a, sample b)
- public abstract operator + (sample a, sample b) public static sample operator +
- (sample a, sample b)
-
Which of the following statements is correct ?
- Each derived class does not have its own version of a virtual method.
- By default methods are virtual.
- All of the above
-
Selecting appropriate method out of number of overloaded methods by matching arguments in terms of number, type and order and binding that selected method to object at compile time is called:
- Static binding
- Static linking
- Compile time polymorphism
-
Select the correct statement about an exception :
- It occurs during loading of program.
- It occurs during Just-In-Time compilation.
- All of the above
Great Work! You are providing HNBGU Previous year question papers which are going to help students a lot.
ReplyDeleteKeep it up your best work.