0% found this document useful (0 votes)
22 views3 pages

C Sharp Interviews Questions

Uploaded by

vishakha kesare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views3 pages

C Sharp Interviews Questions

Uploaded by

vishakha kesare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

C SHARP INTERVIEWS QUESTIONS

1) What is c sharp
Ans- C# is an object-oriented programming language compiled by the .Net framework to
generate Microsoft Intermediate Language. It’s used to create desktop apps, mobile apps,
web apps, websites, and web services.

Latest version of c sharp is 12.

2) How is C# different from C?

Ans- The most significant difference between C# and its predecessor, C, is that C# is an object-
oriented programming language, whereas C is a procedural programming language.

3) what are the different/various types of access specifier


Ans- Public- Public declared variables can be accessed from anywhere in the application, both
within and outside the defining class or struct.(accessible from anywhere)

Private -Private members are accessible only within the same class or struct in
which they are declared .they cannot be accessed from outside the class or
struct,including derived classes.(Accessible only within the same class or struct)
Protected – data members and function are access only in derived class,
protect members are accessible within the same class or struct and any derived
classes.they are not accessible from outside the class or struct ,except through
derived classes. In other words protected members are accessible within the
inheritance hierarachy. (Accessible within the same class or struct and derived
classes)

4) what are different types of argumments?


Ans- 2 types of argumments
Call by value-
Call by reference-

5) Mention all the advantages of C#.


The following are the advantages of C# -

 C# is component-oriented.

 It is an object-oriented language.

 The syntax is really easy to grasp.

 It is easier to learn.

 C# is part of the framework called .NET

6) what is CLR?
Ans- it is a program execution engine that loads and executes the program it
convert the program into native code it acts as an interface between
frameworks and operating system it does exception handling , memory
management and garbage collections.
7) What is the difference between public , static and void?

Ans- public - You can access public declared variables anywhere in the application.

Static - Static declared variables are globally accessible without creating an instance of the
class.

Void - Void is a type modifier that specifies that the method doesn't return any value.

8) What are constructor in c sharp?


Ans-A constructor is a member function in the class and has the same name as its class.
Whenever the object class is created, the constructor is automatically invoked. It constructs
the value of data members while initializing the class. constructor is the method used
to initialize the state of an object and it get invoke at the time of and object
creation. A constructor is a special method that is used to initialize objects. the
constructor name must match the class name, and it cannot have a return
type (like void or int).

Also note that the constructor is called when the object is created.

All classes have constructors by default: if you do not create a class constructor yourself, C#
creates one for you. However, then you are not able to set initial values for fields.
9) What are the different type of constructor?
Ans-

You might also like