title: I had this error: Error 2 Inconsistent accessibility: return type 'johny.Form1.CoOrds' is less accessible than method 'johny.Form1.toto()
body: <pre><code>class CoOrds
  {
      public int x, y;
  
      public CoOrds() {
          x = 0;
          y = 0;
      }
  
      public CoOrds(int x, int y) {
          this.x = x;
          this.y = y;
      }
  }
  
  public CoOrds toto() {
      CoOrds B = new CoOrds(3, 2);
      return B;
  }
  
  private void result_Click(object sender, EventArgs e) {
      l6.Text = "";
      CoOrds D = new CoOrds();
      D = toto();
      l6.Text = "(" + D.x + "," + D.y + ")";
  }
  </code></pre>
  
  <p>I get following error:</p>
  
  <p><code>Error 2 Inconsistent accessibility: return type 'johny.Form1.CoOrds' is less accessible than method 'johny.Form1.toto()</code></p>