Online C# Programming Test - C# Programming Test 7
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 assemblies can be stored in Global Assembly Cache?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
2.
Which of the following .NET components can be used to remove unused references from the managed heap?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : .NET Framework
3.
Which of the following does not store a sign?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Datatypes
4.
What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.WriteLine((float) x + y * z - (x += (short) y));
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Datatypes
5.
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 : Constructors
6.
Which of the following statements are correct about the C#.NET code snippet given below?
class Sample
{
static int i;
int j;
public void proc1()
{
i = 11;
j = 22;
}
public static void proc2()
{
i = 1;
j = 2;
}
static Sample()
{
i = 0;
j = 0;
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
7.
Which of the following statements are correct about static functions?
- Static functions can access only static data.
- Static functions cannot call instance functions.
- It is necessary to initialize static data.
- Instance functions can call static functions and access static data.
- this reference is passed to static functions.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
8.
Multiple inheritance is different from multiple levels of inheritance.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Explanation:
Multiple inheritance means deriving a class from more than one classes. On the other hand, multiple levels of inheritance means a class has been derived from a base class and the base class itself has been derived from another base class. Multiple inheritance is not permitted in C#.NET.
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
9.
The way a derived class member function can access base class public members, the base class member functions can access public member functions of derived class.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Explanation:
Base class cannot access derived class members since it does not have any knowledge of the derived class.
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
10.
Which of the following statement is correct about a String in C#.NET?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
11.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
12.
Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
13.
Which of the following is the correct way to call the function MyFun() of the Sample class given below?
class Sample
{
public int MyFun(int i)
{
Console.WriteLine("Welcome to IndiaBIX.com !" );
return 0;
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
14.
A HashTable t maintains a collection of names of states and capital city of each state. Which of the following is the correct way to find out whether "Kerala" state is present in this collection or not?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
15.
If Sample class has a Length property with get and set accessors then which of the following statements will work correctly?
Sample.Length = 20;
Sample m = new Sample(); m.Length = 10;
Console.WriteLine(Sample.Length);
Sample m = new Sample(); int len; len = m.Length;
Sample m = new Sample(); m.Length = m.Length + 20;
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Properties
16.
Which of the following statements is correct about an Exception?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Exception Handling
17.
Which of the following statements is correct about the C#.NET program given below if a value "ABCD" is input to it?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index;
int vat = 88;
int[] a = new int(5];
try
{
Console.Write("Enter a number: ");
index = Convert.Toint32(Console.ReadLine());
a[index] = val;
}
catch(Exception e)
{
Console.Write("Exception occurred");
}
Console.Write("Remaining program");
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Exception Handling
18.
Which of the following is the correct way to overload + operator?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Polymorphism
19.
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
20.
Which of the following is the correct way to implement the interface given below?
interface IPerson
{
String FirstName
{
get;
set;
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Interfaces
*** 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