Answers for "c# using class"

C#
1

C# Class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MyClass
{
	public class MyClass
	{
      public string MyString;
      public string MyNewString { get; set; }
      string MyThirdString = "Number Three";
      private const int K = 9;
      
      public static Int32 MyStatic;
      public static int MyNewStatic;
        #region
          readoly string JustaString;
          #endregion 
      double MyDouble = 4.68;
    }
}
Posted by: Guest on June-29-2021
1

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
0

c# classes

using System;

class Book
  {
    public string title;
    public string author;
    public int pages;
  }


class MainClass {
  public static void Main (string[] args) {
    Book book1 = new Book();
    book1.title = "Harry Potter";
    book1.author = "JK Rowling";
    book1.pages = 400;
    Console.WriteLine(book1.title);
  }
}
Posted by: Guest on March-17-2021
1

how to create class in C#

class ClassName
{
  
}
Posted by: Guest on November-11-2020

C# Answers by Framework

Browse Popular Code Answers by Language