How to fix "Inconsistent accessibility" property type is less accessible error in C#?

(It Soft) #1

hello programmers!

please sommeone can helpe me to fix this issue

this is My source code :

namespace test
  Class A
     private String x;
Class B
    private A teste;
    public A getTest
      get{return teste;}

I’m not able to run the program due to the error message of inconsistency.

this is the error message

Inconsistent accessibility: property type ‘Test.A’ is less accessible than property ‘Test.B.getTest’

(Kunni Can) #2

it is very easy just make your class public access modifier, add public keyword infront of your class name.

(SAM) #3

Please read the OOP documents, since that’s a basic notation on OOP and C#.

The problem is as follows:

You can’t have a More-Accessible (Public) method or member in a Less-Accessible Class (Private).