Online C# Programming Test - C# Programming Test 6
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 statements is correct about the .NET Framework?
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 statements is correct?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Datatypes
3.
Which of the following is an 8-byte Integer?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Datatypes
4.
Which of the following statements is correct about the C#.NET code snippet given below?
int i, j, id = 0; switch (id)
{
case i:
Console.WriteLine("I am in Case i");
break;
case j:
Console.WriteLine("I am in Case j");
break;
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Control Instructions
5.
Which of the following is NOT an Arithmetic operator in C#.NET?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Operators
6.
What will be the output of the C#.NET code snippet given below?
int i, j = 1, k;
for (i = 0; i < 5; i++)
{
k = j++ + ++j;
Console.Write(k + " ");
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Operators
7.
Which of the following statements are correct?
- C# allows a function to have arguments with default values.
- C# allows a function to have variable number of arguments.
- Omitting the return value type in method definition results into an exception.
- Redefining a method parameter in the method's body causes an exception.
- params is used to specify the syntax for a function with variable number of arguments.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Functions and Subroutines
8.
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 : Classes and Objects
9.
Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{
class Sample
{
int i;
Single j;
public void SetData(int i, Single j)
{
this.i = i;
this.j = j;
}
public void Display()
{
Console.WriteLine(i + " " + j);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(36, 5.4f);
s1.Display();
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Classes and Objects
10.
How many times can a constructor be called during lifetime of the object?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Constructors
11.
Which of the following statements are correct about Inheritance in C#.NET?
- A derived class object contains all the base class data.
- Inheritance cannot suppress the base class functionality.
- A derived class may not be able to access all the base class data.
- Inheritance cannot extend the base class functionality.
- In inheritance chain construction of object happens from base towards derived.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
12.
Which of the following is correct about the C#.NET snippet given below?
namespace IndiabixConsoleApplication
{
class Baseclass
{
public void fun()
{
Console.WriteLine("Hi" + " ");
}
public void fun(int i)
{
Console.Write("Hello" + " ");
}
}
class Derived: Baseclass
{
public void fun()
{
Console.Write("Bye" + " ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d;
d = new Derived();
d.fun();
d.fun(77);
}
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Inheritance
13.
Which of the following statements are correct about the C#.NET code snippet given below?
int[] a = {11, 3, 5, 9, 4};
- The array elements are created on the stack.
- Refernce a is created on the stack.
- The array elements are created on the heap.
- On declaring the array a new array class is created which is derived from System.Array Class.
- Whether the array elements are stored in the stack or heap depends upon the size of the array.
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Arrays
14.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Five Star";
String s2 = "FIVE STAR";
int c;
c = s1.CompareTo(s2);
Console.WriteLine(c);
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Strings
15.
Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below?
class Sample
{
public int func(int i, Single j)
{
/* Add code here. */
}
}
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Delegates
16.
Which of the following is correct ways of applying an attribute?
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 is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Collection Classes
18.
If a Student class has an indexed property which is used to store or retrieve values to/from an array of 5 integers, then which of the following are the correct ways to use this indexed property?
Student[3] = 34;
Student s = new Student(); s[3] = 34;
Student s = new Student(); Console.WriteLine(s[3]);
Console.WriteLine(Student[3]);
Student.this s = new Student.this(); s[3] = 34;
Your Answer: Option
(Not Answered)
Correct Answer: Option
Discuss about this problem : Discuss in Forum
Learn more problems on : Properties
19.
Which of the followings are NOT a .NET namespace?
- System.Web
- System.Process
- System.Data
- System.Drawing2D
- System.Drawing3D
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 modifier is used when a virtual method is redefined by a derived class?
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