static

  1. J

    Resolved Accessing non-static classes from different .cs files.

    Hi everyone! I'm relatively new to all of this, but just got super lost trying to do this one thing, so hopefully someone will be able to tell what I'm doing wrong. Basically for the setup of my project, I have 2 page files in a WPF project. The "main" project has a frame in it that calls the...
  2. D

    Static variable

    Hi, I've created a simplified code for this post : public class Program { public static int value; public string printedValue = $"Value is {value}"; public void printValue() { value = 3; Console.WriteLine(printedValue); }...
  3. P

    Question Why 6 as result?

    Hello! Please, could somone make me clear how did they get the result 6? Why right 6? many thanks!!! using System; namespace StaticVarApplication { class StaticVar { public static int num; public void count() { num++; } public int getNum()...
Back
Top Bottom