Time remaining
:
:
Test Status
CSHARPRANDOMTEST
Ques 1 :
Which of the following constitutes the .NET Framework?
1. ASP.NET Applications
2. CLR
3. Framework Class Library
4. WinForm Applications
5. Windows Services
(A) 2, 5
(B) 2, 1
(C) 2, 3
(D) 3, 4
Ques 2 :
Which of the following utilities can be used to compile managed assemblies into processor-specific native code?
(A) gacutil
(B) ngen
(C) sn
(D) ildasm
Ques 3 :
How can we sort the elements of the array in descending order?
(A) By calling Sortdescending() method
(B) By calling Sort() method
(C) By calling Sort() and then Reverse() methods
(D) By calling Sortreverse() method
Ques 4 :
An Event has _____ as default return type
(A) No return type for events
(B) String
(C) Double
(D) Integer
Ques 5 :
Which of the following statements are correct about the C#.NET code snippet given below?
class Sample
{
static int i;
int j;
public void proc1()
{
i = 11;
j = 22;
}
public static void proc2()
{
i = 1;
j = 2;
}
static Sample()
{
i = 0;
j = 0;
}
}
(A) j can be initialized in proc2().
(B) i cannot be initialized in proc1().
(C) proc1() can initialize i as well as j.
(D) proc2() can initialize i as well as j.
Ques 6 :
What is the Difference between Convert.ToInt32 and Int.Parse?
(A) Both are Same
(B) Convert.ToInt32 Can't Handle Null Values ,it will throws rgumentNullException error.
(C) Int.Parse Can't Handle Null values , It will throws ArgumentNullException Error.
(D) Both can Handle Null Values
Ques 7 :
Which of the following statements is correct?
(A) A constructor can be used to set default values and limit instantiation.
(B) Destructors are used with classes as well as structures.
(C) A class can have more than one destructor.
(D) C# provides a copy constructor.
Ques 8 :
What compiler switch creates an xml file from the xml comments in the files in an assembly?
(A) /text
(B) /xml
(C) /doc
(D) /help
Ques 9 :
Which is true about Interface and abstract methods?
(A) We can write only one abstract method inside interface.
(B) No method is abstract inside interface
(C) All the methods inside Interface in an abstract method.
(D) None of the above
Ques 10 :
Is there any errors in this -> EmployeeMgmt constructor: Public int EmployeeMgmt { emp_id = 100; }
(A) Return type
(B) Formal parameters
(C) No errors
(D) Name
Ques 11 :
Difference between Convert.ToString() and ToString()
(A) Convert.ToString() handle null values but ToString() don't
(B) Convert.ToString() only handle null values
(C) ToString() handle null values but Convert.ToString() don't
(D) ToString() output as per format supplied
Ques 12 :
Which of the following are NOT true about .NET Framework?
1. It provides a consistent object-oriented programming environment whether
object code is stored and executed locally, executed locally but Internet-
distributed, or executed remotely.
2.It provides a code-execution environment that minimizes software deployment and versioning conflicts.
3.It provides a code-execution environment that promotes safe execution of code, including code created by an
unknown or semi-trusted third party.
4.It provides different programming models for Windows-based applications and Web-based applications.
5.It provides an event driven programming model for building Windows Device Drivers.
(A) 1, 2
(B) 2, 4
(C) 4, 5
(D) 1, 2, 4
Ques 13 :
Which of the following benefits do we get on running managed code under CLR?
1. Type safety of the code running under CLR is assured.
2. It is ensured that an application would not access the memory that it is not
authorized to access.
3. It launches separate process for every application running under it.
4. The resources are Garbage collected.
(A) Only 1, 2 and 4
(B) Only 2, 3 and 4
(C) Only 1 and 2
(D) All of the above
Ques 14 :
Which of the following statements is correct about the C#.NET program given below?
namespace PskillsConsoleApplication
{
class Baseclass
{
int i;
public Baseclass(int ii)
{
i = ii;
Console.Write("Base ");
}
}
class Derived : Baseclass
{
public Derived(int ii) : base(ii)
{
Console.Write("Derived ");
}
}
class MyProgram
{
static void Main(string[ ] args)
{
Derived d = new Derived(10);
}
}
}
(A) The program will report an error in the statement base(ii).
(B) The program will work correctly if we replace base(ii) with base.Baseclass(ii).
(C) The program will output: Base Derived
(D) The program will work correctly only if we implement zero-argument constructors in Baseclass as well as Derived class.
Ques 15 :
___________________ allow to encapsulate discrete units of functionality and provide a graphical representation of that functionality to the user
(A) object
(B) controls
(C) class
(D) graphics
Ques 16 :
When doing an Update, which method of the SqlCommand is best to use?
(A) ExecuteQuery
(B) ExecuteUpdate
(C) ExecuteNonQuery
(D) ExecuteCommand
Ques 17 :
What is the output of the code public class B : A { }
(A) It defines a class that inherits the public methods of A only.
(B) It defines a class that inherits all the methods of A but the private members cannot be accessed.
(C) Errors
(D) a and b
Ques 18 :
What object can help you maintain data across users?
(A) Session object
(B) Server Object
(C) Response Object
(D) Application Object
Ques 19 :
Which of the following statements is correct about constructors?
(A) Static constructors can use optional arguments.
(B) Overloaded constructors cannot use optional arguments.
(C) If we provide a one-argument constructor then the compiler still provides a zero-argument constructor.
(D) If we do not provide a constructor, then the compiler provides a zero-argument constructor.
Ques 20 :
Which of the following is/are not types of arrays in C#?
(A) Single-Dimensional
(B) Multidimensional
(C) Jazzed arrays
(D) Jagged arrays
Submit Answer
Don't Refresh the Page !! ...