Freshers Question Paper
Freshers Question Paper
Freshers Question Paper
shape obj;
obj = new shape();
a) Creates an object of class shape.
b) To create an object of type shape on the heap or stack depending on its size.
c) Create a reference obj of the class shape and an object of type shape on the
heap.
d) Create an object of type shape on the stack.
3) Which Of The Following Statements Correctly Tell The Differences Between ‘=’
And ‘==’ In C#?
a) ‘==’ operator is used to assign values from one variable to another variable
‘=’ operator is used to compare value between two variables.
b) ‘=’ operator is used to assign values from one variable to another variable
‘==’ operator is used to compare value between two variables
c) No difference between both operators
d) None of the mentioned
b) Long
c) Short
d) Byte
e) Integer
b) Byte
c) Integer
d) Short
e) Long
c) 2, 4
d) 3, 5
b) 8 byte
c) 16 byte
d) 32 byte
8) Which of the following statements are TRUE about the .NET CLR?
It provides a language-neutral development & execution environment.
It ensures that an application would not be able to access memory that it is not authorized to
access.
It provides services to run "managed" applications.
The resources are garbage collected.
It provides services to run "unmanaged" applications.
a) Only 1 and 2
b)
b) Only 1, 2 and 4
c) 1, 2, 3, 4
d) Only 4 and 5
e) Only 3 and 4
label:
i++;
j+=i;
if (i < 10)
{
Console.Write(i +" ");
goto label;
}
a) Prints 1 to 9
b) Prints 0 to 8
c) Prints 2 to 8
d) Prints 2 to 9
b) The switch statement can include any number of case instances with two case statements
having the same value.
c) A jump statement such as a break is required after each case block excluding the last
block if it is a default statement.
d) The if statement selects a statement for execution based on the value of a Boolean
expression.
e) C# always supports an implicit fall through from one case label to another.
11) Which of the following will be the correct output for the C#.NET code snippet
given below?
String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai");
Console.WriteLine(s2);
a) NagpuMumbair
b) Nagpur Mumbai
c) Mumbai
d) Nagpur
e) NagpurMumbai
12) Which of the following will be the correct output for the C#.NET code snippet
given below?
String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(s1.Length);
a) 3 6
b) 2 5
c) 3 5
d) 2 6
e) 3 7
13) Which of the following statements is correct?
a) A constructor can be used to set default values and limit instantiation.
14) Which of the following ways to create an object of the Sample class given below
will work correctly?
class Sample
{
int i;
Single j;
double k;
public Sample (int ii, Single jj, double kk)
{
i = ii;
j = jj;
k = kk;
}
}
e) Sample s1 = new Sample();
15) 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.
a) 1, 2, 4
b) 2, 3, 5
c) 3, 4
d) 4, 5
e) None of these
16) In C#.NET if we do not catch the exception thrown at runtime then which of the
following will catch it?
a) Compiler
b) CLR
c) Linker
d) Loader
e) Operating system
17) Which of the following statements are correct?
b) 1, 5
c) 3, 4
d) 2, 3
18) Which of the following statements are correct about data types?
Each value type has an implicit default constructor that initializes the default value of that type.
It is possible for a value type to contain the null value.
All value types are derived implicitly from System.ValueType class.
It is not essential that local variables in C# must be initialized before being used.
Variables of reference types referred to as objects and store references to the actual data.
a) 1, 3, 5
b) 2, 4
c) 3, 5
d) 2, 3, 4
19) Which of the following are the correct way to initialise the variables i and j to a
value 10 each?
int i = 10; int j = 10;
int i, j;
i = 10 : j = 10;
int i = 10, j = 10;
int i, j = 10;
int i = j = 10;
a) 2, 4
b) 1, 3
c) 3, 5
d) 4, 5
20) Which of the following statement correctly assigns a value 33 to a variable c?
byte a = 11, b = 22, c;
e) c = (byte) (a + b);
f) c = (byte) a + (byte) b;
g) c = (int) a + (int) b;
h) c = (int)(a + b);
i) c = a + b;