20 Sep 2017

what is static method With Example

Static method always call same as the class name.Static method does not depend any object.and Static method can be define in static class, but we can not define in non static class.

you can use access modifier before static mathod like as a Public,Private,etc.

Syntax of Static Method:-

Example of Static Method in C#:-

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

namespace What_is_static_method
    static class Program
        public static void show()
            Console.WriteLine("Hello Rock programmer");
        class Dev
            static void Main(string[] args)

No comments:
Write comments

Contact Form


Email *

Message *

© 2014 Rock Programmer . Designed by Bloggertheme9
Powered by Rock Programmer.