Copy link:
Copy

Which of the following statements are correct about an ArrayList collection that implements the IEnumerable interface?
The ArrayList class contains an inner class that implements theIEnumerator interface.
An ArrayList Collection cannot be accessed simultaneously by different threads.
The inner class of ArrayList can access ArrayList class's members.
To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to it.
Enumerator's of ArrayList Collection can manipulate the array.

Which of the following statements are correct about arrays used in C#.NET?
Arrays can be rectangular or jagged.
Rectangular arrays have similar rows stored in adjacent memory locations.
Jagged arrays do not have an access to the methods of System.ArrayClass.
Rectangular arrays do not have an access to the methods of System.ArrayClass.
Jagged arrays have dissimilar rows stored in non-adjacent memory locations.

Which of the following is NOT an interface declared in System.Collections namespace?
IComparer
IEnumerable
IEnumerator
IDictionaryComparer
IDictionaryEnumerator

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.

Can an Interface be instantiated directly?
Yes
No

Automatic paging is possible in
datareader
dataset

What does Dispose method do with connection object?
Close the connection
Temporary dispose the connection
Deletes it from the memory
All of the above

What is the Difference between Convert.ToInt32 and Int.Parse?
Both are Same
Int.Parse Can't Handle Null values , It will throws ArgumentNullException Error
Convert.ToInt32 Can't Handle Null Values ,it will throws ArgumentNullException error
Both can Handle Null Values

Is it possible to pass a parameter with ref keyword to a constructor?????? ?? ? ??????????? ???????? ???????? ? ???????? ?????? ref?
yes
no

When is Finalize called from objects?????? ?????????? Finalize ? ?????????
????? ??????????? ????? FinallyBefore finally block is implemented
????? ????, ??? GC ????????? ?????????? ???????? ??????When CG has released object's storage
????? ?????????? ????? finallyAfter finally block is implemented
?????? ??? CG ????????? ?????????? ???????? ??????Before CG has released object's storage

What is the output for the below code snippet?????? ????? ????????? ?????????? ? ?????????? ????:using System.IO;using System;class Program{ static void Main() { try { string str = null; Console.WriteLine(str.Length); } catch (Exception e) { Console.WriteLine("str = " + str); } }}
Nothing will be displayed?????? ?? ????? ????????
Compile-time error?????????? ?????? ??????????
0
-1
str = null

What is the output for the below code snippet?using System;public class Test{ public static void Main() { int i = 3; switch (i) { case 3: case 2: Console.WriteLine(2); break; case 1: default: Console.WriteLine(0); } }}
?????????? ?????? ??????????Compile-time error
0
2
20

What is the output for the below code snippet?using System;sealed class A { }class B: A { }public class Test{ public static void Main() { B b = new B(); A a = b; Console.WriteLine(a == b); }}
True
?????????? ?????? ??????????Compile-time error
False
?????????? ?????? ??????????Runtime error

What is the output for the below code snippet?using System.IO;using System;class Program{ static void Main() { Console.WriteLine(1 % -2); Console.WriteLine(-1 % 2); Console.WriteLine(-1 % -2); }}
-11-1
-1-11
111
1-1-1

Will the finally block get executed if an exception has not occurred?
Yes
No

If a method is marked as protected internal, who can access it?
Classes that are both in the same assembly and derived from the declaring class.
Only methods that are in the same class as the method in question.
Internal methods can only be called using reflection.
Classes within the same assembly, and classes derived from the declaring class.

Can multiple catch blocks be executed for a single try statement?
Yes
No

Check all statements that are true.
Every process runs in a thread
Every thread runs in a process
A process can have multiple threads
A thread can have multiple processes
All threads run in the same process

Can you change the value of a variable while debugging a C# application?
Yes
No

Which of the following can be used to declared as a virtual in a class?
Methods
Properties
Events
Fields

Where the properties can be declared?
Class
Struct
Namespace
Interface

Which of the following statements are true about the C#.NET code snippet given below?String s1, s2; s1 = "Hi"; s2 = "Hi";
String objects cannot be created without using new.
Only one object will get created.
s1 and s2 both will refer to the same object.
Two objects will get created, one pointed to by s1 and another pointed to by s2.

What value will be the x variable set to, if the output of the following code snippet is "false"?????? ???????? ????????? x, ???? ??????????? ???? ??? ??????? False?float x; Console.Write(x == x);
0
NaN

What is the output for the below code snippet???? ????? ???????? ?? ????? ??? ?????????? ???????????? ???? ?????static void Main(string[] args) { char a = 'a'; int b = 0; Console.WriteLine(true ? a : b); }
a
97
0

What is the output for the below code snippet?class Program { static void Main(string[] args) { Console.WriteLine(Foo("Original string")); } public static string Foo(string str) { try { return str; } finally { Console.WriteLine("In finally"); str = "Somewhere in finally"; } } }
In finallySomewhere in finally
Compilation error
Original string
In finallyOriginal string

What is the output for the below code snippet?Console.WriteLine("A" + "B" + "C"); Console.WriteLine('A' + 'B' + 'C');
ABC ABC
ABC 198
198 198
ABC

What properties are declared correctly?????? ???????? ????????? ??????????using Syst?m; n?m?s???? Q { ?l?ss N?m? { ?ubli? string ? { ?riv?t? s?t; g?t; } private string ? { public s?t; public g?t; } privat? string x; ?ubli? string ? { g?t { return x.ToString(); } } ?ubli? string D { s?t { x = value; } private get; } } }
A
B
C
D

public abstract class A { public virtual string Print() { return "A"; } } public class B : A { public override new string Print() { return "B"; } } public class C : B { public string Print() { return "C"; } } ????? ????? ????????? ??? ?????????? ?????????? ????:A ac = new C(); Console.WriteLine(ac.Print());
A
B
C
?????? ??????????

Which strings of the following code snippet contain errors?? ????? ??????? ???? ???????? ???????using System; namespace Inheritance { class A { } interface Inner { } struct S : A, Inner //1 { int num = 10; //2 public S() //3 { } static S() //4 { } } class Program { static void Main(string[] args) { S obj = new S(); //5 } } }
1
2
3
4
5

What is the output for the below code snippet???? ????? ???????? ?? ??????? ??? ?????????? ????? ????:using System; using System.Collections.ObjectModel; using ByteCollection1 = System.Collections.ObjectModel.Collection; namespace CollectionApplication { class Program { class ByteCollection2 : Collection { } static void Main(string[] args) { Console.WriteLine(typeof(ByteCollection1) == typeof(Collection)); Console.WriteLine(typeof(ByteCollection2) == typeof(Collection)); } } }
FalseFalse
TrueTrue
FalseTrue
TrueFalse

The C# keyword "int" maps to which .NET type?
System.Int16
System.Int32
System.Int128
System.Int64

What is boxing?
Encapsulating an object in a value type
Encapsulating a copy of a value type in an object
Encapsulating a copy of an object in a value type
Encapsulating a value type in an object

What is the output of the short program below? class Program { static String location; static DateTime time; static void Main() { Console.WriteLine(location == null ? "location is null" : location); Console.WriteLine(time == null ? "time is null" : time.ToString()); }}
1/1/0001 12:00:00 AM
location is null1/1/0001 12:00:00 AM
Compilation error
{empty string}

What is the difference between const and readonly???? ?????????? ????????? ? ????????? ?????? ??? ?????? ?????
There is no difference????? ?? ??????????
Constants are initialized at compile time, while readonly fields are initialized at runtime????????? ???????????????? ?? ????? ??????????, ????????? ?????? ??? ?????? ???? - ?? ????? ??????????
Constants are initialized at compile time, while readonly fields are initialized at runtime????????? ?????? ??? ?????? ???? ???????????????? ?? ????? ??????????, ????????? - ?? ????? ??????????
It is possible to change the value of const, while readonly fields can't change their values????????? ????? ????????, ? ????????? ?????? ??? ?????? ???? - ???

What statements are true about struct (value-type)??????????? ??????????? ????????? (value-?????)
Interface implementation?????????? ???????????
Boxing/Unboxing
Event usage????????????? ???????
Class inheritance???????????? ?? ???????
Parameterless(default) constructors overriding ??????????????? ???????????? ?? ?????????
Static constructor definition??????????? ???????????? ????????????

There is given extension method:? ???? ????????? extension-?????:public static class ExtensionMethods { public static bool IsEmptyIntArray(this int[] input) { if (input == null) return true; return !input.Any(); } } What is the output for the below code snippet???? ????? ??? ?????????? ?????????? ????:int[] nullArray = null; var hasItems = !nullArray.IsEmptyStringArray(); Console.WriteLine(hasItems);
Unhandled Exception: System.ArgumentNullException: Value cannot be null
true
false

There is given extension method for string:??? extension-????? ??? ???????? ?????? ? ??????? ???????:public static string ToUpper(this string value) {//// Uppercase the first letter in the string this extension is called on.//if (value.Length > 0){ char[] array = value.ToCharArray(); array[0] = char.ToUpper(array[0]); return new string(array);}return value; }What is the output for the below code snippet???? ????? ???????? ?? ????? ??? ?????????? ??????? ????:string value = "interview";value = ToUpper(); // Called like an instance method.Console.WriteLine(value);
?????? ??????????Compile-time error
Interview
INTERVIEW
interview

What is the output for the below given program?public class Test{ public static void Main(){ int y = 5;F(out y);Console.Write(y);}public static void F(out int x){x = x + 20;}}
Compilation error, since out variable should not be initialized before be
Compilation error, sicne out variable should be initialized before usage in method
25

What is the output for the below code snippet?class Program { static void Main() { int a = 3; Print(a); } private static void Print(int variable) { System.Console.WriteLine("THE VALUE: " + variable.ToString()); } private static void Print(T variable) { System.Console.WriteLine("Passed value: " + variable.ToString() ); }}
THE VALUE : 3
Passed value: 3
Compilation error

What statements are true for abstract classes in C#?????? ?? ??????????? ??? ??????????? ??????? ? C# ???????? ????????????
Abstract classes can inherit no more than two interfaces??????????? ?????? ?? ????? ??????????? ?????? ???? ???????????
Abstract class can contain either abstract or virtual members??????????? ????? ????? ???????? ??? ??????????? ????? ??? ? ???????????
Abstract class can't be instantiated?????? ????????? ????????? ???????????? ??????
Abstract class can inherit abstract class only??????????? ?????? ????? ??????????? ?????? ??????????? ??????
It's impossible to define fields in abstract class? ??????????? ??????? ?????? ?????????? ????

What is the output for the below code snippet?????? ????? ????????? ?????????? ? ?????????? ?????????? ?????using System;public class Test{ public static void Main() { Console.WriteLine(0 / 0.0 == 0 / 0.0); }}
?????????? ?????? ??????????Compile-time error
?????????? ?????? ??????????Runtime error
True
False

What is the output for the below code snippet?????? ????? ????????? ?????????? ? ?????????? ????????? ?????????:using System.IO;using System;class Program{ static void Main() { int i = 0; i += i++ + i++; Console.WriteLine(i); }}
4
3
2
1
0

What is the output for the below code snippet?using System;using System.Collections.Generic;public class Test{ public static void Main() { Dictionary dic = new Dictionary(); int i = 0; dic["id"] = 5; if (dic.TryGetValue("id", out i)) { Console.WriteLine("id = {0}", i); } }}
id = 5
?????????? ?????? ??????? ??????????Runtime error
?????? ?? ???????Nothing will be displayed
?????????? ?????? ??????????Compile-time error
id = 0

What is the output for the below code snippet?using System.IO;using System;class Program{ static void Main() { int? i = null; Console.WriteLine(i ?? Convert.ToInt32(i.HasValue)); }}
null
0
?????????? ?????? ??????????Compile-time error
False
?????????? ?????? ??????????Runtime error

What is the output for the below code snippet?using System;public class Runner{ public static void Main() { Runner r = new Runner(); Console.WriteLine(r); }}
0
?????????? ?????? ??????????Compile-time error
?????????? ?????? ??????????Runtime error
int
Runner

What is the output for the below code snippet?using System.IO;using System;class Program{ static void Main() { object a = 1; object b = 1; if(b == a) { Console.WriteLine("equal"); } else { Console.WriteLine("not equal"); } }}
equal
not equal
?????????? ?????? ??????????Compile-time error

What is the output for the below code snippet?using System;public class Test{ public static void Main() { Method(1, 2); } static void Method(params int[] a) { Console.WriteLine(1); } static void Method(int a, int b) { Console.WriteLine(2); } static void Method(int a, params int[] b) { Console.WriteLine(3); }}
1
2
3
?????????? ?????? ??????????Compile-time error

For the below code snippet:??? ????????? ???:using System; class A { }class B: A { }class Program { static void Main() { A obj = new B(); } }????? ?? ????????????? ????????? ?????? True?which of the following expressions will return True?
obj.GetType() == typeof(B)
obj is A
obj.GetType() == typeof(A)
obj is B

What is the output for the below code snippet?using System;class Program{ static void Main(string[] args) { Console.WriteLine(Test(1)); } public static int Test(int i) { try { return i; } finally { Console.WriteLine("In finally"); i = 2; } }}
In finally1
1
?????????? ?????? ??????????Compile-time error
In finally2

What is the output for the below code snippet?using System;class Test{ static void Main(string[] args) { Console.WriteLine(Method(1)); } public static int Method(int i) { try { return i; } finally { i = 2; } return 3; }}
2
1
3
?????????? ?????? ??????????Compile-time error

What method definitions contain errors?? ??????????? ????? ??????? ?????? ???????? ???????public class Test{ public void M1(int[] a, int[] b) { } public void M2(int[] a, params int[] b) { } public void M3(params int[] a, int[] b) { } public void M4(params int[] a, params int b) { } }
M1
M2
M3
M4

What is the difference between interface and abstract class???????? ??????? ?????????? ?? ???????????? ??????:
? ?????????? ?????? ???????? ???????????? ???????you cannot change access modifiers in interface
????????? ????? ??????????? 2 ? ????? ??????interface can be derived from 3 and more classes
?????????? ??????????? ?????? ?????????? ? ????? 'I'.interfaces names have to start with 'I' prefix
????????? ?????????? ????? ???????interface can be instantiated
? ?????????? ?????? ????????? ????????interface mustn't contain delegates declaration

What is the output for the below code snippet?????? ????? ????????? ?????????? ? ?????????? ?????????? ????:using System.IO;using System;class Program{ static int a = getB(); static int b = 5; static int getB() { return b; } static void Main() { Console.WriteLine(a); }}
null
Compile-time error
5
0

Copy link:
Copy

Authored by:

Tests Created: 2

  • 2 Followers
  • Send message
More Tests By Author:
Interview_Bizapps (15 Questions)
73
attempts
Discussion
Your Facebook Friends on WizIQ