- 1
- 2
- 3
- 4
- Next Page »
A Learning Portal from Recruitment India
The methods that have the same name, but different parameter lists and different definitions is called______.
Method Overriding
Method Overloading
Method Overreading
Method Overwriting
Answer with explanation
Answer: Option BExplanation
Method Overloading
Workspace
Which method of character stream class returns the numbers of characters successfully read starting at count?
int ReadBlock(char[ ] buffer, int index, int count)
int Read(char[] buffer, int index, int count)
int Read()
None of the mentioned
Answer with explanation
Answer: Option BExplanation
Attempts to read the count characters into buffer starting at buffer[count], returning the number of characters successfully read.
Workspace
Which of the following statements is true about an enum used in C#.NET?
An enum variable can be defined inside a class or a namespace.
An enum variable cannot have a private access modifier.
An enum variable cannot have a public access modifier.
An implicit cast is needed to convert from enum type to an integral type.
Answer with explanation
Answer: Option AExplanation
An enum variable can be defined inside a class or a namespace.
Workspace
Which of the following statements correctly tell the differences between ‘=’ and ‘==’ in C#?
‘==’ operator is used to assign values from one variable to another variable
‘=’ operator is used to compare value between two variables
‘=’ operator is used to assign values from one variable to another variable
‘==’ operator is used to compare value between two variables
No difference between both operators
None of the mentioned
Answer with explanation
Answer: Option BExplanation
‘=’ operator is used to assign values from one variable to another variable
‘==’ operator is used to compare value between two variables
Workspace
Choose the file mode method which is used to create a new output file with the condition that the file with the same name must not exist.
FileMode.CreateNew
FileMode.Create
FileMode.OpenOrCreate
FileMode.Truncate
Answer with explanation
Answer: Option AExplanation
Creates a new output file. The file must not already be existing.
Workspace
The property signifies “Obtains a Module object that represents the module (an executable file) in which the reflected type resides”. Choose the property which specifies the following statement:
Module Module
Type DeclaringType
int MetadataToken
Type ReflectedType
Answer with explanation
Answer: Option AExplanation
Module Module
Workspace
If a function fun() is to receive an int, a Single & a double and it is to return a decimal then which of the following is the correct way of defining this function?
decimal static fun(int i, Single j, double k)
{ ... }
decimal fun(int i, Single j, double k)
{ ... }
static decimal fun(int i, Single j, double k)
{ ... }
static decimal fun(int i, Single j, double k) decimal
{ ... }
Answer with explanation
Answer: Option CExplanation
static decimal fun(int i, Single j, double k)
{ ... }
Workspace
Which of the following is the correct about static member variables of a class?
We can define class members variables as static using the static keyword
When we declare a member of a class as static, it means no matter how many objects of the class are created, there is only one copy of the static member
Both of the above.
None of the above
Answer with explanation
Answer: Option CExplanation
Both of the above
Workspace
For building new types at runtime which class can be used?
System
System.Object
System.NewClass
System.Reflection.Emit.
Answer with explanation
Answer: Option DExplanation
For building new types at runtime System.Reflection.Emit namespace will be used. This namespace provides you a number of classes which you can use to build your type
Workspace
Select the wrong statement about ‘ref’ keyword in C#
When ‘ref’ are used, any changes made to parameters in method will be reflected in variable when control is passed back to calling method
The ‘ref’ keyword causes arguments to be passed by reference
References can be called recursively
All of the above mentioned
Answer with explanation
Answer: Option CExplanation
References can be called recursively
Workspace
The correct way to define a variable of type struct abc among the following is?
abc e = new abc();
abc();
abc e; e = new abc;
abc e = new abc;
Answer with explanation
Answer: Option AExplanation
abc e = new abc();
Workspace
Which of the following statements is correct?
A struct never declares a default constructor.
All value types in C# inherently derive from ValueType, which inherits from Object.
A struct never declares a default destructor.
In C#, classes and structs are semantically same.
Answer with explanation
Answer: Option BExplanation
All value types in C# inherently derive from ValueType, which inherits from Object.
Workspace
To apply an attribute to an Assembly, the correct way of implementation is?
AssemblyInfo: AssemblyDescription (“Csharp”)
assembly: AssemblyDescription(“Csharp”)
AssemblyDescription(“Csharp”)
Assembly:AssemblyDescription(“Csharp”)
Answer with explanation
Answer: Option BExplanation
assembly: AssemblyDescription(“Csharp”)
Workspace
Which of the following statements are correct?
1.A struct can contain properties.
2.A struct can contain constructors.
3.A struct can contain protected data members.
4.A struct cannot contain methods.
5.A struct cannot contain constants.
1, 2
3, 4
1, 2, 4
3, 5
Answer with explanation
Answer: Option AExplanation
1,2 statements are correct
Workspace