News
IBM to offer mobile security as a service IBM will start delivering mobile security-as-a-service (MaaS) through its own cloud infrastructure in India, a move that is expected to better address in-country data requirements... IBM Spectrum Computing: IBM has enlarged its portfolio of software-defined infrastructure solutions with cognitive features for workload management.  * LiFi internet technology has been introduced, the new type of wireless internet connection that gives 100 times faster than traditional WiFi -- Invented by Professor Harald Haas from the University of Edinburgh. * Sci. Rachid Yazami has developed a smart chip that charges smartphones in less than 10 minutes. BenQ has launched BlueCore projector - Consumer electronics major BenQ has launched its first BlueCore laser light source projector. For those unaware, devices with BlueCore laser technology have a high contrast output of 80000:1 with an extended lamp life and efficiency. *** 
Category - C# Interview Questions
 
1. What is C#?
Ans:
  • C# is an object oriented, type safe and managed language that is compiled by .Net framework to generate Microsoft Intermediate Language.

2. What is object?
Ans:
  • Any real time entity is called as an object.
  • Every object consist of state(look and feel) and behaviour(what is does).
  • States are called as fields and behaviors are called as methods.

3. What is a class?
Ans:
  • Class is a blueprint of an object.
  • It consists of fields which are not allowed to access from outside the class.
  • It also consists of methods which are allowed to access from outside the class.


4. What are access modifiers?
Ans:
  • Access Modifiers (Access Specifiers) describes as the scope of accessibility of an Object and its members.
  • All C# types and type members have an accessibility level.
  • We can control the scope of the member object of a class using access specifiers.
  • We are using access modifiers for providing security of our applications.
  • When we specify the accessibility of a type or member we have to declare it by using any of the access modifiers provided by CSharp language.
Types of Access Specifiers:
  • public
  • private
  • protected
  • internal
  • protected internal
In tabular Form:


ModifierDescription
publicThere are no restrictions on accessing public members.
privateAccess is limited to within the class definition. This is the default access modifier type if none is formally specified
protectedAccess is limited to within the class definition and any class that inherits from the class
internalAccess is limited exclusively to classes defined within the current project assembly
protected internalAccess is limited to the current assembly and types derived from the containing class. All members in current project and all members in derived class can access the variables.


5. What is the difference between value type and reference type?
Ans:
Value type: 

Value type is the data type variable for which the memory is allocated at compile time. This concept is also called as early binding or static binding.

Reference type:

Reference type is the data type variable for which the memory is allocated at runtime. This concept is also called as late binding or dynamic binding

6. What is constructor?
Ans:
  • Constructor is a special method which has same name as class name.
  • It does not have return type, but can have parameters.
  • It should be public; in some situations it can be private.
  • Default Constructor of a class is without any parameters.
  • Constructor is invoked automatically when we create an object.
  • You cannot invoke constructor explicitly.


7. What is the use of constructor?
Ans:
  • Constructor is used to initialize the object.

8. What is constructor overloading?
Ans:
If we have more than one constructor in a class with different parameters then we called it as constructor overloading.

9. What is Method overloading?
Ans:
If in a class there is more than one method, with the same name but different parameters then we call this as method overloading.

10. What is compile time or static polymorphism?
Ans:
In method Overloading the code for the method is generated at compile time itself. Hence it is called as static polymorphism.

12345
Search
Recent Posts
Create Amazon ElasticCache Using Memcached in CSharp
Oct 29 2018 12:09PM Posted By Amose
Get Google Map Lat Lng (Geo Point) By Pincode in C#
Oct 28 2018 12:09PM Posted By Pranav
Google URL Shortener in C#
Oct 20 2018 12:09PM Posted By Sanjay
Bind Gridview from CSV file in Asp.Net C#
Oct 5 2018 12:09PM Posted By Michael
Call WebService method from jQuery in every 1 minute
Sep 26 2018 12:09PM Posted By John
Gridview custom CSS in ASP.Net
Sep 14 2018 12:09PM Posted By Micheal Ryan
Read excel file and bind to Gridview in C#
Sep 10 2018 12:09PM Posted By Micheal
Tags
Follow us on Facebook
Follow us on Google +
Recent post in your Email inbox.
Enter your email address: