Dot Net Only Ques
Dot Net Only Ques
Dot Net Only Ques
a) 1
b) 2
c) Any number
d) None of the mentioned
2. Correct way to define object of sample class in which code will work correctly is:
class abc
int i;
float k;
i = ii;
k = kk;
5. Which of these is used as a default specifier for a member of the class if no access
specifier is used for it?
a)private
b) public
c) public, within its own class
d) protected
6. Which of these is used to access members of class before the object of that class is
created?
a) public
b) private
c) static
d) protected
int a = 5;
int b = 10;
int c;
Console.WriteLine(c = ++ a + b ++);
Console.WriteLine(b);
Console.ReadLine();
}
a) 11, 10
b) 16, 10
c) 16, 11
d) 15, 11
char a = 'A';
string b = "a";
Console.WriteLine(Convert.ToInt32(a));
Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));
Console.ReadLine();
a) 1, 97
b) 65, 97
c) 65, 97
d) 97, 1
a) Dr.Gupta
b) Good Morning
c) Good Morning Dr.Gupta
d) Good Morning name
10. Select output for the following set of code .
const int a = 5;
const int b = 6;
a = a * i;
b = b * i;
Console.WriteLine(a);
Console.WriteLine(b);
Console.ReadLine();
a) 600, 720
b) Compile time error.
c) 25, 30
d) 5, 6
Mul();
m();
Console.ReadLine();
Console.WriteLine("4");
Console.WriteLine("3");
Mul();
a) 4 3 3
b) 4 4 3
c) 4 3 4
d) 3 4 4
m();
Console.ReadLine();
Console.WriteLine("HI");
m();
a) HI HI HI
b) HI
c) Stack overflow exception
d) Compile time error
int i = 10;
double d = 35.78;
fun(i);
fun(d);
Console.ReadLine();
Console.WriteLine(d);
a) 35.78
10
b) 10
35.00
c) 10
35.78
15. Which procedure among the following should be used to implement a ‘Has a’ or a ‘Kind
of’ relationship between two entities?
a) Polymorphism
b) Inheritance
c) Templates
d) All of the mentioned
22. If no access modifier for a class is specified,then class accessibility is defined as?
a) public
b) protected
c) private
d) internal
int i, j;
arr[i, j] = i * 2 + i * 2;
Console.WriteLine(arr[i, j]);
Console.ReadLine();