Thread: I get errors while adding text to player

Results 1 to 4 of 4
  1. #1 I get errors while adding text to player 
    Registered Member
    Join Date
    Aug 2008
    Posts
    127
    Thanks given
    1
    Thanks received
    1
    Rep Power
    4
    Alright I'm reading a tutorial how to add pk points to my server and the first step is this:

    Quote Originally Posted by Core View Post

    Open up the player class and at the top add
    Code:
    public int playerKilled;
    public ArrayList <Integer>killedPlayers = new ArrayList<Integer> ();
    I get this error:

    Code:
    Player.java:1: class, interface, or enum expected
    public int playerKilled;
           ^
    Player.java:2: class, interface, or enum expected
    public ArrayList <Integer>killedPlayers = new ArrayList<Integer> ();
           ^
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Aug 2008
    Posts
    127
    Thanks given
    1
    Thanks received
    1
    Rep Power
    4
    Anyone ?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2008
    Posts
    127
    Thanks given
    1
    Thanks received
    1
    Rep Power
    4
    +rep to anyone who can help me ? >.>
    Reply With Quote  
     

  4. #4  
    Registered Member
    Deadly Uzi's Avatar
    Join Date
    Jul 2008
    Posts
    994
    Thanks given
    177
    Thanks received
    87
    Rep Power
    362
    You have to put that code INSIDE the class declaration, like

    Code:
    public class Player {
    // CODE HERE
    You probably put it outside the declaration, just put the code ONE LINE UNDER, public class Player.
    Attempting to develop a multi-revision library. See it on GitHub.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •