Calling a Class Method on a Class : Object Instance « Class Interface « C# / C Sharp






Calling a Class Method on a Class



using System;
public class MainClass {
    public static void Main() {

        string firstName = "J";
        string lastName = "R";
        string name = string.Format("{0} {1}", firstName, lastName);
        Console.WriteLine(name);
    }
}


       








Related examples in the same category

1.Object.ReferenceEquals Method
2.Calling an Instance Method on an Object
3.Catch NullReferenceException Exception
4.Object assignment
5.Point object
6.Pass by ref for object parameters