What is object-oriented programming (OOP) Language?

Object-oriented programming (OOP) is a programming language model organized around objects rather than “actions” and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.

Explain about C# Language.

C# is a OOPs language, .net framework use to compiled it, to generate machine code.

Types of comments in C#?

Single line comments
// for single line comments

Multiple line comments
/* for multi line comments */

XML tags comments

/// XML tags displayed in a code comment

Top reason to use C# language?

Modern, general-purpose programming language
Object oriented.
Component oriented.
Easy to learn.
Structured language.
It produces efficient programs.
It can be compiled on a variety of computer platforms.
Part of .Net Framework.

Different between method overriding and method overloading?

In Overriding methods it will create two or more methods with same name and same parameter in different classes.

while Overloading it will create more then one method with same name but different parameter in same class.

Explain use of Abstract and Sealed Classes in C#?
The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.

The sealed keyword enables you to prevent the inheritance of a class or certain class members that were previously marked virtual.

What is Static Classes?

A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated.
In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself.

Explain Static Class Members.
A non-static class can contain static methods, fields, properties, or events.

The static member is callable on a class even when no instance of the class has been created. The static member is always accessed by the class name, not the instance name. Only one copy of a static member exists, regardless of how many instances of the class are created.

Static methods and properties cannot access non-static fields and events in their containing type, and they cannot access an instance variable of any object unless it is explicitly passed in a method parameter.

Which are Access Modifiers available in C#?

All types and type members have an accessibility level, which controls whether they can be used from other code in your assembly or other assemblies.

You can use the following access modifiers to specify the accessibility of a type or member when you declare it:
public: The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private: The type or member can be accessed only by code in the same class or struct.
protected: The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.
internal: The type or member can be accessed by any code in the same assembly, but not from another assembly.

C#.Net was last modified: October 1st, 2017 by Justin Antony

About Justin Antony


Leave a Reply