ジェネリックにアップグレードしたいレガシーコードがいくつかあります。
/**
* Places in this World
*/
public Map places;
/**
* Players watching this World
*/
public Collection players;
/**
* A reference to the Adventure using this World
*/
public Adventure owner;
/**
* Create a World. `a' is a reference to the Frame itself.
* This reference is used when loading images and sounds.
*
* @param a An instance of adventure.
*/
public World( Adventure a ) {
places = new HashMap();
players = new LinkedList();
owner = a;
}
places
IDEは、変数をパラメーター化していないことを警告しているplayers
ので、このコードにジェネリックスを追加する必要がありますが、どうすればよいですか?<>
またはを`places´オブジェクトに追加する<Place>
と、ジェネリックではないと表示されるので、間違っていることがわかります。コードのこの部分をジェネリックスを使用するように最新化する方法を教えてください。
ありがとう