음 못 알아 듣겠다.
내가 경험한 일은, private로 선언한 타입을 public 함수에서 리턴할 수 없었다!
You have to declare the access level of the Content class public as well.public class Content { // some code }
As stated in the documentation:
A public variable cannot be defined as having an internal or private type, because the type might not be available everywhere that the public variable is used.
Classes are declared as internal by default, so you have to add the public keyword to make them public.
A similar rule exists for functions as well.
A function cannot have a higher access level than its parameter types and return type, because the function could be used in situations where its constituent types are not available to the surrounding code.
'취업,면접 대비 > cs 전공 공부' 카테고리의 다른 글
<객체지향> 인스턴스 맴버, 클래스 맴버, 스태틱 맴버란? (0) | 2020.03.16 |
---|---|
<디자인 패턴> MVC vs MVVM 비교 1편 (0) | 2020.03.13 |
RestAPI란? (0) | 2020.03.11 |
url 규칙 (0) | 2020.03.11 |
HTTP에서 GET, POST의 차이점 (0) | 2020.03.11 |