Valerie Meunier

Valerie Meunier

  • NA
  • 693
  • 84.4k

why not allowed: name="Bob"; ?

Jun 26 2021 9:06 AM

Hi

why is this not possible (name="Bob") and why is this allowed: static string name="Bob"?

Thanks

using System;
public class oef2
{
    static string naam;
    name="Bob";
    public static void Welkom()
    {
        Console.WriteLine("Welkom " + name + " !");
    }
    public static void Main(string[] args)
    {
        Welkom();
    }
}


Answers (3)