Thread: How would I use this?

Results 1 to 5 of 5
  1. #1 How would I use this? 
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    My error.
    Code:
    src\server\model\players\Client.java:218: unreported exception java.lang.Excepti
    on; must be caught or declared to be thrown
            Server.bh.removeTarg(playerId);
                                ^
    src\server\model\players\Client.java:522: unreported exception java.lang.Excepti
    on; must be caught or declared to be thrown
                                    Server.bh.removeTarg(playerId);
                                                        ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    The method:
    Code:
    	public void removeTarg(int playerId) throws Exception {
    		Client player = (Client) PlayerHandler.players[playerId];
    		if (player == null) {
    			return;
    		}
    		inBh.remove(playerId);
    	}
    }
    Incorrect Example:
    Code:
    Server.bh.removeTarg(playerId);
    Any help? Thanks.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Nov 2010
    Posts
    78
    Thanks given
    4
    Thanks received
    2
    Rep Power
    0
    Is the 'Server.bh.removeTarg(playerId);' Suppose to be an import?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    Yes, but I need to figure out how to use the method...
    Reply With Quote  
     

  4. #4  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    around that line do

    Code:
    try {
    Code:
    }catch (Exception e){ 
    
    }
    Please consider getting an IDE like eclipse, will help you will all these issues your having.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    Lol, just figured it out as soon as you posted. I have eclipse but never use it. Thanks though you're always a help.
    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
  •