Monday, 19 September 2016

Rephrased... not

So apparently dropping a declaration into the namespace doesn't work ie.e
namespace map
{
        private Random r = new Random(System.DateTime.Now.Millisecond);
       ....
}

It basically told me that the Random, was not going to happen.
But dropping it into the static class Program, at least recognised that it was a keyword

static class Program
{
        private Random r = new Random(System.DateTime.Now.Millisecond);
        ....
}

But trying to compile told me to go do something more productive with my time than write bad code.  But I did learn that you can't go declaring any old thing in the static class.

No comments:

Post a Comment