Class declaration with a public method that has a parameter. : public : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » public »

 

Class declaration with a public method that has a parameter.








    


       

using System;

public class MyClass
{
   public void DisplayMessage( string courseName )
   {
      Console.WriteLine( "Welcome to the grade book for\n{0}!",courseName );
   }
}
public class MyClassTest
{
   public static void Main( string[] args )
   {
      MyClass myMyClass = new MyClass();
      Console.WriteLine( "Please enter the course name:" );
      string nameOfCourse = Console.ReadLine(); 
      Console.WriteLine(); 
      myMyClass.DisplayMessage( nameOfCourse );
   } 
}
    
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» public