Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

arrayList.size has private access?? wtf?

807600May 18 2007 — edited May 18 2007
I have been messing with ArrayList for awhile and today well working on this zombie game I'm making for class I got an error that I have never seen before and do not understand why I get this here is the code:
import java.util.ArrayList;

public class Room
{
    private String description;
    public HashMap<String, Room> exits;
    public static Room currentRoom;
    public ArrayList<Room> roomList = new ArrayList();
    
    public Room(String description) 
    {
        this.description = description;
        exits = new HashMap<String, Room>();
        roomList.add(this);
    }
    
    public void placeRandomZombies()
    {
        int listSize = roomList.size;
    }
And the error:

size has private access in java.util.ArrayList

Your help is much greatful
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2007
Added on May 18 2007
3 comments
4,988 views