문제

I write:

public interface Map <Key, Value> cells;

eclipse complains and says "{ expected".

public interface Map <Key, Value> cells{};

I then write the above in eclipse and it complains "Syntax error on token "cells", delete this token".

What on earth should i do? Google is not my friend here as i can't find code snippets to work out the syntax of this.

도움이 되었습니까?

해결책

Are you trying to declare a member variable named cells? If so, the way to do it is:

public class Foo {

   // ...

   public Map<Type1, Type2> cells;

   // ...

}

If you are trying to declare a variable within a method, do this:

public class Foo {

    // ...

    public void myMethod() {
        // ...

        Map<Type1, Type2> cells;

        // ...
    }

    // ...
}

Edit: It looks like you are confused by Map <Key, Value>, so I'll try to explain.

Key is a placeholder for the data type that the Map object will use for its set of keys. Similarly, Value is a placeholder for the data type that it will use for its set of values. A valid combination would be, for example, Map <String, Integer>. This means that the Map object will map a set of String objects to a set of Integer objects.

다른 팁

설치 및 구성 마법사가 완료된 후에는 농장에서 우리가 가지고있는 것입니다.

1) 빌드 번호를 확인하십시오 (새로운 것일 것임).
2) 팜의 관리 서버에서> 서버가 필요하지 않은지 확인하십시오
3) 중앙 관리> 업그레이드 마이그레이션> 데이터베이스 상태 검토 및 모든 DB가 "아무런 조치 필요 없음"을 확인하십시오
4) 모든 서버에서 모든 응용 프로그램 풀이 실행되고 있는지 확인하십시오
5) 모든 서버에서 실행되는 타이머 서비스 및 관리 서비스
6) 중앙 관리> 서버의 Manager Services에서 모든 필수 서비스가 적절한 서버에서 시작되었습니다.
7) 검색을 위해 크롤링을 실행하고 문제없이 완료되었는지 확인하십시오
8) UPA의 경우 UPA 동기화를 실행하고 문제없이 완료되었는지 확인하십시오.
9) 모든 웹 응용 프로그램을 탐색하고 확인하고 실행 중입니다.
10) web.config 또는 15 하이브에 수정 된 경우 모든 사용자 정의가 예상대로 작동하는지 확인하십시오. 10) 마지막으로 최종 사용자 테스트가 있어야합니다. 모든 업데이트 후에 실행됩니다. 최종 사용자 테스트 평균, 테스트 사이트 모음에서 하위 사이트 만들기, 워크 플로 만들기, 워크 플로우 실행, 파일 업로드 파일, 파일 삭제 등 또한 수정 사항을 소개하거나 테스트하는 기능을 테스트합니다.

SP2013에서는 워크 플로 관리자가 있으므로 워크 플로가 예상대로 작동하는지, OWA가있는 경우에도 테스트하십시오.
잘하면이 도움이 당신을 도와주세요.

What are you trying to do ? Define a new type or define a member of type Map?

If you are defining a member, you don't need the interface keyword before it. You only need interface if you are defining a new type.

You want:

public Map<Key,Value> cells;

To create a variable called cells of type Map.

public interface Map<Key,Value> cells;

Is declaring (incorrectly) a user-defined interface called Map - probably not what you are trying to do.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top