Thread: Importing Methods From Another Class.

Results 1 to 6 of 6
  1. #1 Importing Methods From Another Class. 
    steve20007
    Guest
    Well, Here Goes LOL

    1. 1st make sure the method you are going to import is static
    eg:
    Code:
    public static void importingClass() {
    }
    2. open the class that you will be importing the method to
    3. add
    Code:
    import static classname.methodname;
    post errors, here. should be none

    this is what the outcome should be

    instead of using
    Code:
    TelePortHandler.TeleTo("Varrock", 25);
    you would use
    Code:
    TeleTo("Varrock", 25);
    hope this helped

    if you want to import all the methed use the import like this
    Code:
    import static MethodName.*;
    FeedBack Is Nice

    Note: This is not leeched from moparscape, i am X_blitz_X if you want proof say so.
     

  2. #2  
    Registered Member
    Alex's Avatar
    Join Date
    Apr 2007
    Posts
    1,658
    Thanks given
    0
    Thanks received
    0
    Rep Power
    284
    so is this used to make handlers!?
    Your password is 354 days old, and has therefore expired.


    Fail
     

  3. #3  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    i think is not i can find u tutorial for making handlers
     

  4. #4  
    Registered Member
    Alex's Avatar
    Join Date
    Apr 2007
    Posts
    1,658
    Thanks given
    0
    Thanks received
    0
    Rep Power
    284
    ahh ok......
    Your password is 354 days old, and has therefore expired.


    Fail
     

  5. #5  
    steve20007
    Guest
    You could make a handler then import it into the client class and then instead of using
    Code:
    handlername.methodname();
    you would jus use
    Code:
    methodname();
    simple
     

  6. #6  
    Fallen Azn SinZ
    Guest
    It's pretty good, but you should explain why the 'static' statement is there so 'it can be called on from any class, without hassle.' (I think, I can't remember what it was)
     


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
  •