title: Create 2D map on which objects can be placed and move in Java
body: <p>I am new to Java and I'm trying to make a 2D text-based game that internally consists of a world map on which objects can interact and move. However, I'm already confused at the very beginning. Let's say that I have a 3x3 map. Each tile then, is a value in a multidimensional array (e.g. the tile on coordinates [0][2]). However, each tile must be <strong>an array of objects</strong> (e.g. either a tile object (Forest, Ground, Desert) or an entity (Person, Rock, Duck)). It should be an array since each tile must at least contain one tile object (Forest, Ground, Desert) but can contain a theoretical infinite number of entities.</p>
  
  <p>I tried and combined some of the answers here. Current idea is to make a superclass entity that has nothing but coordinates. When the entity is created (given some coordinates), the object is linked to the world map on that position (doesn't seem to work). The World Map is a multidimensional array that can hold Entities.</p>
  
  <p>The entity isn't linked to the world map, and I can't figure out why. It's definitely going wrong in the Entity.java and the World.java files, but I'm still unsure how to set the position to the world map. <strong>Note that I would need to set or change the position of the entity from the map later on, or remove the entity as a whole (including its position on the map).</strong></p>