Skip to main content

C# interview Question

 


C# interview Question  

What is C# (C-Sharp)

C-Sharp is a Object oriented programming language that was developed by Microsoft run on .NET Core and .NET Framework. its similar to other programming language like c, c++ and java


what different in C# from C 

c in Procedural programming language and c# is object oriented programming language. C# hase garbage collector managed by CLR (Common language runtime). c supports pointers and c# supports pointers only in unsafe mode. c execute on cross platform but c# required .net core or .net Freamework. total 32 keyword used in c programming and 86 keyword used in c#


What is CLR (common language runtime)

common language runtime is Virtual machine component. it is run time environment in .Net framework. CLR help in run the code and making development process easier and providing various services like thread management, memory management, type safety etc. 


what is indexers in c#

indexers is smart array in C#. indexers allows the objects of class to be indexed in the same form as array


what is JIT (Just-in-time) Compiler 

just-in-time compiler is a part of CLR (common language runtime). it is responsible for managing the execution regardless program. compiler converts the source code to the intermediate language this intermediate language is converted into machine code by JIT (Just-in-time) compiler


what is garbage collector

garbage collector is responsible for memory management. in .net  memory management is automatic with the help of GB (garbage collector). when class object is created  runtime certain memory allocated in heap memory after the complete the related action allocated memory is waste and it cannot be used in this case GB (garbage collector) automatically releases the memory space


how many types of classes 

mainly four type of classes in .Net Abstract class, Partial Class, Sealed Class, Static class


difference between interface and abstract class

interface use for declaration abstract class contains declaration and definition both. multiple inheritance achieved by the interface but not in abstract class. interface does not contain constructor but abstract class contain constructor. abstract class contain static members but interface not. interface contain only public access modifier but abstract class contain public, private and protected access modifiers. class can use multiple interface but class use only one abstract class. interface contain only methods but abstract class contain  field, methods, constants variable, etc.


what is inheritance

inheritance is an important part of object oriented programming. interface is standard where one class is allowed to inherit the another class (methods and fields)


can c# support multiple inheritance?

c# Does not support multiple inheritance. in multiple inheritance one class more then one superclass and all its parent class.  to solve this problem we use interface to archive multiple inheritance


managed code in c#

the code write to aim to get the services of the managed runtime environment execution like CLR. managed code always implemented by managed runtime environment instead of directly exe by operating system. managed runtime environment provide service like garbage collection, exception handling, type checking, etc.


difference between a struct and a class

a class is contains fields and methods and structure is a collection of variables of different data type in single unit. both are almost similar 


Enum

Enum (Enumeration)  is a value data type use for assign name and values constants for program easy to read and maintain. the aim objective of enum is to define own data type enum declared using enum keyword


difference between ref and out

ref keyword use to passing the argument by a reference if we change in argument in the method it will reflect in that variable ref does not pass the property

out keyword use to passing the argument to methods as a reference type. it is use where method returns multiple values

Comments

Popular posts from this blog

What is OOP (objects oriented programming) in C#

 What is OOP? in C# OOP is Object Oriented programming miens contain methods and data in objects it's called objects oriented programming(OOP) OOP Advantages Provides clear visibility and code for the programs easier to maintain, modify and debug Faster development easier and faster to execute create reusable code make your code neat and clean and easy to understand What is Class and objects in C# Class and object are the two main points of OOP (object oriented programming), when fruit is a class then Apple, Guava, Banana,  is object, when the individual objects are created they inherits all variables and method form the class, class is a template for the objects and object is instance of the class If you like this blog so pls share and  Write Comments  about Your experience, Thank You.

Make api in DotNet Core in 10sec | Create universal api for SQL server

Make API in Dot Net Core in 10sec | Create universal API for SQL server Universal API is great concept for app and angular developer need only connect to data base add table name and access table crud operation using API's  If you like this blog so pls share and  Write Comments  about Your experience, Thank You.

How to Optimize Your LinkedIn Profile as a Software Developer: Tips for Success

How to Optimize Your LinkedIn Profile as a Software Developer: Tips for Success To make your LinkedIn profile more attractive and discoverable as a software developer, you should focus on creating a compelling profile that showcases your skills, experience, and potential. Below are some specific strategies: 1. Professional Profile Picture Use a clear, professional photo where you look approachable and confident. A headshot with a neutral background works well. 2. Headline Your headline should be more than just your job title. Make it a powerful value proposition. Consider including: Your current role, tech stack, or specialization. Highlight key skills (e.g., "JavaScript | React | Node.js | Full-Stack Developer"). Optional: Include a personal tagline (e.g., "Building innovative web applications that solve real-world problems"). Example: "Full-Stack Developer | React, Node.js, Python | Passionate About Clean Code & Scalable Systems" 3. Summary (About Se...