C# - Programming Language
This course covers the basics of programming in C#. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Classes & Objects

Lesson 25
Author : Mike Dane
Last Updated : November, 2017


Code

Copypublic class Book{
     public string title;
     public string author;
}

public class App
{
     public static void Main(string[] args)
     {
          Book book1 = new Book();
          book1.title = "Harry Potter";
          book1.author = "JK Rowling";

          Console.WriteLine(book1.title);

          Book book2 = new Book();
          book2.title = "Lord of the Rings";
          book2.author = "JRR Tolkien";

          Console.WriteLine(book2.title);
     }
}