Thread: whats wrong

Results 1 to 3 of 3
  1. #1 whats wrong 
    Member whats wrong Market Banned

    Robin Spud's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    2,338
    Thanks given
    46
    Thanks received
    73
    Rep Power
    1068
    hey, im creating my own skills and so far i have this

    i added

    Code:
    import Java.Skills.Skills;
    in client.java
    then made a Skills folder made a skill.java and put this in it


    Code:
    package Java.Skills;
    import java.io.*;
    import java.*;
    
    public class Skills {
    	public Client client;
    
    
    
    public void hello(){
    c.sendMessage("hello.");
    	}
    }
    but when i compile i get this error

    Code:
    ..\Java\Skills\Skills.java:6: cannot find symbol
    symbol  : class Client
    location: class Java.Skills.Skills
            public Client client;
                   ^
    .\Java\Skills\Skills.java:11: cannot find symbol
    symbol  : variable c
    location: class Java.Skills.Skills
    c.sendMessage("hello.");
    ^
    Note: .\Java\stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Press any key to continue . . ..
    ILY Stewie.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Aug 2008
    Posts
    162
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Code:
    public void hello(int a){
    
    client c  = (client) server.PlayerHandler.playerId[a];
    
    c.sendMessage("hello.");
    	}
    }

    for delta i think, but im sure you get my point.
    Reply With Quote  
     

  3. #3  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    663
    Rep Power
    5000
    Okay

    You need to sort out some imports:

    import your Client class.

    e.g;
    import Java.Client;

    You will also need a constructor:

    public Skills(Client client) {
    this.client = client;
    }
    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
  •