Thursday 16 July 2015

100 TOP MOST C#.NET OBJECTIVE INTERVIEW QUESTIONS and ANSWERS

C#.NET OBJECTIVE INTERVIEW QUESTIONS and ANSWERS :-


[1]Which of these is a valid path declaration?

(A)string strPath="c:\\abc.txt";
(B) string strPath=@"c:\abc.txt";
(C) string strPath="c:/abc.txt";
(D) All of these
 
Answer :
All of these
 
Discription :
 
[2]Which of the following are not types of access modifiers in C#?
 
(A)external protect
(B) internal protect
(C) protect
(D) internal
 
Answer :
external protect
 
Discription :
 
[3]A variable which is declared inside a method is called a________variable
 
(A)Local
(B) Private
(C) Static
(D) Serial
 
Answer :
Local
 
Discription :
 
[4]Which of the following statements is correct about the C#.NET code snippet given below?

namespace PskillsConsoleApplication
{
    class Sample
    {
        public int func()
        {
            return 1;
        }
        public Single func()
        {
            return 2.4f ;
        }
    }
    class Program
    {
        static void Main(string[ ] args)
        {
            Sample s1 = new Sample();
            int i;
            i = s1.func();
            Single j;
            j = s1.func();
        }
    }
}
 
(A)func() is a valid overloaded function.
(B) func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
(C) Overloading works only in case of subroutines and not in case of functions.
(D) The call j = s1.func() will assign 2.4 to j.
 
Answer :
func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
 
Discription :
 
[5]Which of the following in not service model (three-tier application) in c sharp?

(A)Presentation (UI)
(B) Business (logic and underlying code)
(C) Database (for storing the data)
(D) Data (from storage or other sources)
 
Answer :
Database (for storing the data)
 
Discription :
 
[6]Managed methods will be marked as----------- in MSIL code
 
(A)mscorjit
(B) cil
(C) dgclr
(D) None
 
Answer :
cil
 
Discription :
 
[7]In data reader, what can be used before read method?

(A)Getvalue
(B) Getstring
(C) GetNumber
(D) None
 
Answer :
None
 
Discription :
 
[8]How does assembly versioning in .NET prevent DLL Hell?

(A)The runtime checks to see that only one version of an assembly is on the machine at any one time.
(B) The compiler offers compile time checking for backward compatibility.
(C) .NET allows assemblies to specify the name AND the version of any assemblies they need to run.
(D) It doesn.t.
 
Answer :
.NET allows assemblies to specify the name AND the version of any assemblies they need to run.
 
Discription :
 
[9]An Event has _____ as default return type
 
 (A)No return type for events
(B) String
(C) Double
(D) Integer
 
Answer :
No return type for events
 
Discription :
 
[10]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
 
Answer :
2, 3
 
Discription :
 
[11]
What object can help you maintain data across users?

(A)
Session object
(B) Server Object
(C) Response Object
(D) Application Object
 
Answer :
Application Object
 
Discription :
 
[12]
Which of the following are valid .NET CLR JIT performance counters?

1. Total memory used for JIT compilation
2.Average memory used for JIT compilation
3.Number of methods that failed to compile with the standard JIT
4.Percentage of processor time spent performing JIT compilation
5.Percentage of memory currently dedicated for JIT compilation

(A)
1, 2
(B) 1, 5
(C) 3, 4
(D) 4, 5
 
Answer :
3, 4
 
Discription :
 
[13]
In C#, by default structs are passed how?
 
(A)
By reference.
(B) By value.
(C) By address.
(D) By memory.
 
Answer :
By value.
 
Discription :
 
[14]
What does a strong name contain?

(A)
publiuc key
(B) assembly name
(C) assembly version
(D) All of the above
 
Answer :
All of the above
 
Discription :
 
[15]
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
 
Answer :
Int.Parse Can't Handle Null values , It will throws ArgumentNullException Error.
 
Discription :
 
[16]
If a method is marked as protected internal who can access it?
 
 (A)
Classes within the same assembly, and classes derived from the declaring class.
(B) Internal methods can be only be called using reflection.
(C) Only methods that are in the same class as the method in question.
(D) Classes that are both in the same assembly and derived from the declaring class.
 
Answer :
Classes within the same assembly, and classes derived from the declaring class.
 
Discription :
 
[17]
What is a satellite Assembly?

(A)
A peripheral assembly designed to monitor permissions requests from an application.
(B) An assembly containing localized resources for another assembly.
(C) An assembly designed to alter the appearance or .skin. of an application.
(D) Any DLL file used by an EXE file.
 
Answer :
An assembly containing localized resources for another assembly.
 
Discription :
 
[18]
Which of the following statements are TRUE about the .NET CLR?

1. It provides a language-neutral development & execution environment.
2.It ensures that an application would not be able to access memory that it is not authorized to access.
3.It provides services to run "managed" applications.
4.The resources are garbage collected.
5.It provides services to run "unmanaged" applications.

(A)
Only 1 and 2
(B) Only 1, 2 and 4
(C) 1, 2, 3, 4
(D) Only 4 and 5
 
Answer :
1, 2, 3, 4
 
Discription :

 
[19]
___________________ 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
 
Answer :
controls
 
Discription :
 

[20]
What does Dispose method do with connection object?

(A)
Close the connection
(B) Temporary dispose the connection
(C) Deletes it from the memory
(D)
All of the above
 
Answer :
Deletes it from the memory

No comments:

Post a Comment