Online C# Programming Test - C# Programming Test 4
Instruction:
- This is a FREE online test. Beware of scammers who ask for money to attend this test.
- Total number of questions: 20.
- Time allotted: 30 minutes.
- Each question carries 1 mark; there are no negative marks.
- DO NOT refresh the page.
- All the best!
Marks : 2/20
Total number of questions
20
Number of answered questions
0
Number of unanswered questions
20
Test Review : View answers and explanation for this test.
1.
Which of the following are NOT true about .NET Framework?
- It provides a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.
- It provides a code-execution environment that minimizes software deployment and versioning conflicts.
- It provides a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.
- It provides different programming models for Windows-based applications and Web-based applications.
- It provides an event driven programming model for building Windows Device Drivers.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
2.
What will be the output of the C#.NET code snippet given below?
int val;
for (val = -5; val <= 5; val++)
{
switch (val)
{
case 0:
Console.Write ("India");
break;
}
if (val > 0)
Console.Write ("B");
else if (val < 0)
Console.Write ("X");
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Control Instructions
3.
Which of the following CANNOT occur multiple number of times in a program?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Functions and Subroutines
4.
Which of the following statements are correct about functions and subroutines used in C#.NET?
- A function cannot be called from a subroutine.
- The ref keyword causes arguments to be passed by reference.
- While using ref keyword any changes made to the parameter in the method will be reflected in that variable when control passes back to the calling method.
- A subroutine cannot be called from a function.
- Functions and subroutines can be called recursively.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Functions and Subroutines
5.
Which of the following statements is correct about the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int index;
public int[] arr = new int[10];
public void fun(int i, int val)
{
arr[i] = val;
}
}
class MyProgram
{
static void Main(string[] args)
{
Sample s = new Sample();
s.index = 20;
Sample.fun(1, 5);
s.fun(1, 5);
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Classes and Objects
6.
Which of the following is the correct way to create an object of the class Sample?
- Sample s = new Sample();
- Sample s;
- Sample s; s = new Sample();
- s = new Sample();
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Classes and Objects
7.
Which of the following statements are correct?
- Data members ofa class are by default public.
- Data members of a class are by default private.
- Member functions of a class are by default public.
- A private function of a class can access a public function within the same class.
- Member function of a class are by default private.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Classes and Objects
8.
Which of the following is the correct way to define the constructor(s) of the Sample class if we are to create objects as per the C#.NET code snippet given below?
Sample s1 = new Sample();
Sample s2 = new Sample(9, 5.6f);
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
9.
There is no private or protected inheritance in C#.NET.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
10.
If a base class contains a member function func(), and a derived class does not contain a function with this name, an object of the derived class cannot access func().
Your Answer: Option
(Not Answered)
Correct Answer: Option
Explanation:
It depends upon how the function func() has been defined in the base class. If the function func() is defined public in base class then an object of the derived class can access the function func().
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
11.
If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
12.
Creating empty structures is allowed in C#.NET.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Structures
13.
With which of the following can the ref keyword be used?
- Static data
- Instance data
- Static function/subroutine
- Instance function/subroutine
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
14.
Which of the following statements is incorrect about a delegate?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
15.
Which of the following statements is incorrect about delegate?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
16.
The [Serializable()] attribute gets inspected at
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Attributes
17.
Which of the following statements are correct about Attributes in C#.NET?
- On compiling a C#.NET program the attibutes applied are recorded in the metadata of the assembly.
- On compilation all the attribute's tags are deleted from the program.
- It is not possible to create custom attributes..
- The attributes applied can be read from an assembly using Reflection class.
- An attribute can have parameters.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Attributes
18.
Which of the following C#.NET code snippets will correctly print "Hello C#.NET"?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Namespaces
19.
Which of the following is absolutely neccessary to use a class Point present in namespace Graph stored in library?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Namespaces
20.
Which of the following statements is correct?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Polymorphism
*** END OF THE TEST ***
Time Left: 00:29:56
Post your test result / feedback here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers