Answers for "which keyword is used to create a class in c#"

C#
0

How to create a class and objects in C#

class ClassName {
  static void printText(string text) {
    Console.WriteLine(text);
    Console.ReadLine();
    //Console.ReadLine(); is for keeping the window open
  }
  
  static void Main(string[] args) {
    //the object printText
    printText("Hello, World");
  }
}
Posted by: Guest on November-01-2021
0

creating a class in c#

//Declaring an object of type MyClass.
MyClass mc = new MyClass();

//Declaring another object of the same type, assigning it the value of the first object.
MyClass mc2 = mc;
Posted by: Guest on June-24-2021

Code answers related to "which keyword is used to create a class in c#"

C# Answers by Framework

Browse Popular Code Answers by Language