Write Hello World Program Using Constructor Method


The basic purpose of this article is to help the beginner level programming student who has no experience in programming.


This article belongs to basic C# program language, because each student has a different reason to write a program, but I am writing this program with some different strategies to enhance the thinking of new developers in the field of programming.

Using Code:

Step 1:
Create a new project of C#, which is normally Console Application based.


Step 2: After creating the project add Class in project,


Click on add button and the class is added in your project

Step 3: Make a default constructor In Class1.cs which is normally the same as class.


Step 4: Now make an instance of class in the main program (Program.cs),


Step 5: Run the program to press the start button when you want to see the result.


Step 6: Hello World appears in your front screen:


Points of Interest/Remember:

What is default Constructor?

A default constructor is basically a type of method which calls itself when the program loads, because the default constructor always calls itself when the instance of class has been created. So when I create the instance of class, the default constructor called itself, which is in Class1.cs,

  • The class & constructor name is always the same.
  • You should try writing this on your own.