Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Top 10 C

Top 10 C
1. Which of the following is the correct way to create an object of the class Sample?
1.Sample s = new Sample();
2.Sample s;
3.Sample s; s = new Sample();
4.s = new Sample();
  1, 3
  2, 4
  1, 2, 3
  4, 5
2. 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)
{
i = i;
j = j;
}
public void Display()
{
Console.WriteLine(i + " " + j);
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Sample s1 = new Sample();
s1.SetData(10, 5.4f);
s1.Display();
}
}
}
  0 0
  10 5.4
  10 5.400000
  10 5
3. The this reference gets created when a member function (non-shared) of a class is called?
  True
  False
4. Which of the following statements is correct about the C#.NET code snippet given below?

int i;
int j = new int();
i = 10;
j = 20;
String str;
str = i.ToString();
str = j.ToString();
  This is a perfectly workable code snippet.
  Since int is a primitive, we cannot use new with it.
  Since an int is a primitive, we cannot call the method ToString() using it.
  I will get created on stack, whereas j will get created on heap.
5. Which of the following statements are correct about the C#.NET code snippet given below?

int[ , ] intMyArr = {{7, 1, 3}, {2, 9, 6}};
1.intMyArr represents rectangular array of 2 rows and 3 columns.
2.intMyArr.GetUpperBound(1) will yield 2.
3.intMyArr.Length will yield 24.
4.intMyArr represents 1-D array of 5 integers.
5.intMyArr.GetUpperBound(0) will yield 2.
  1, 2
  2, 3
  2, 5
  1, 4
6. In a HashTable Key cannot be null, but Value can be?
  True
  False
7. Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?
  arr.Count
  arr.GrowSize
  arr.MaxIndex
  arr.Capacity
8. Which of the following statements is correct?
  A constructor can be used to set default values and limit instantiation.
  C# provides a copy constructor.
  Destructors are used with classes as well as structures.
  A class can have more than one destructor.
9. Is it possible to invoke Garbage Collector explicitly?
  Yes
  No
10. Is it possible for you to prevent an object from being created by using zero argument constructor?
  Yes
  No
©2017 WithoutBook