answersLogoWhite

0

How you define a class in C sharp?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

The simplest way to define a class, assuming you're within a namespace:

class MyClassName {

}

And to include it in a separate namespace, and have it accessible anywhere (public):

namespace MyNameSpace {

public class MyClassName {

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How you define a class in C sharp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which class is used to define the controls in c sharp?

.Ascx class file is used to define the controls in c#


Which class is used to define the controls in c?

In .NET, the class name is System.Windows.Forms.Control


How can you store Class properties in Array in c sharp?

vcbvcbcvb


What is class in c sharp?

A class contains methods that can be used in different programs and can be transfered and reused.


Why class is publicly define in c sharp?

If you want a class to be used by any other applications, it must be defined as "public". It is especially true for those "library" classes from Microsoft. Any C# application has at least 1 class to start with. That class does not need to be public, because it is yours only. (the default accessor is internal) However, if you want that class publicly available for other application, that class must be defined as public.


What is abstarct class in C sharp?

This is like a tamplate. You make this kind of class and than later you can override it and put it to use.


What are some of the benefits of programming in C Sharp?

There are many advantages to C sharp programming like: Not having to define the Headers (.h), Classes can be defined within classes, classes and functions can be defined in random order unlike C and C++, Classes and functions don't need to be declared in the program.


What is message passing in c plus plus?

-define class with necessary data member & member function. -create object of that class. -communication.


What are the notes to?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the Flute btw idk what instrument its on


What are the notes to fireflies?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the flute btw idk what instrument its on


Why c sharp called component oriented language?

The basic coding unit of C# is a class. Both data members and methods (functions, procedures) must be defined within a class. The class itself is the basic unit of a component. A class must define within a namespace. The namespace concept in C# (a way of organizing custom design classes, interfaces, struts, and enums) actually fit perfectly with a Component. C# is a language provides the features in Component and Objects, but the actual construction of a software may not be in any way in the shape of Component, nor object. It may be just a plain C codes wrapped in a class.


How do you play Simpson theme on keyboard?

here it is C,E,F SHARP,A,G,E,C,A,F SHARP,F SHARP,F SHARP,G,A SHARP,C,C,C,C