Я развиваю класс для Лица, и у меня есть вопрос или два об этом.Как исправить это предупреждение?
/**
* ADT for persons which is completed which subclasses
* to creating actors with specific properties
*/
public class Person {
/**
* Name of the Person.
*/
public String name;
/**
* The World which this Person is associated with.
*/
public World world;
/**
* Tells where this Person is at the moment.
*/
public Place where;
/**
* The inventory, contains Things.
*/
public Collection<Thing> inventory;
/**
* Shows how the Person looks like
*/
public Image appearance;
/**
* Create Person named `name' in world `world'.
*
* @param world The world where the Person is created.
* @param name Name of the Person.
* @param app An image used to display the Person.
*/
public Person(World world, String name, Image app) {
this.world = world;
this.name = name;
this.appearance = app;
where = world.defaultPlace();
where.enter(this);
inventory = Collections.synchronizedCollection(new LinkedList());
}
...
Если класс Person быть открытым или может по умолчанию доступ будет лучше? Разве это не странно, что человек, частный Человек должен быть общественным, хотя значения здесь не совсем одинаковы.
Как я должен обращаться с аркой, когда моя IDE предупреждает о
inventory = Collections.synchronizedCollection(new LinkedList());
? Он предупреждает о безопасности моего типа.
Спасибо