Results 1 to 2 of 2

Thread: Deledate method

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    2

    Question Deledate method

    hi plz help me

    i got a question in interview that

    what is delegate method. why it is used and to which it extends..

    Last edited by kissuisin; 02-07-2008 at 10:09 PM. Reason: title is wrong it is delegate method

  2. #2
    Banned
    Join Date
    Oct 2007
    Answers
    173

    Re: Deledate method

    Delegate Methods
    Eclim supports generation of delegate methods via the :JavaDelegate command. To utilize this functionality you must first place the cursor on a global field (in the main source file class or within an inner class), and then invoke the :JavaDelegate command.

    In the following source, you can place the cursor anywhere starting from the first 'p' in private, to the trailing semicolon, and then invoke the :JavaDelegate command.

    private List myList;
    Invoking this command with the cursor on some other source element will generate the appropriate error.

    Once successfully invoked, the result will be the opening of a lower window with all the methods that may be inserted that will delegate to the value of the field.

    Here is a section of the content displayed when invoking the command on a field of type java.util.List like the one above.

    com.test.TestList

    package java.util;
    public interface List
    public abstract int size ()
    public abstract boolean isEmpty ()
    public abstract boolean contains (Object o)
    public abstract Object[] toArray ()
    ...
    From this newly opened window you can select a method by simply hitting with the cursor over the method signature and a delegate method will be created.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact