2 interfaces for one method ???.

Hi, anybody can see what will happen if we implemented two interfaces , each of which have a method named e.g. move()for example, Cowboy and Shape.
Thanks
Mario

If the methods in the different interfaces have
different parameters or the same return type, it's not
a problem. Otherwise a compile-time error occurs.
shakes head Nope. Consider the following code:
// File = TestI.java
public interface TestI
    public void test();
// File = TestI2.java
public interface TestI2
    public void test();
// File = Test.java
public class Test
    public static void main(String arg[])
        new Test().test();
    public void test()
        System.out.println("Hello, world!!");
}This code both compiles and runs. A compile-time error will probably result if the two interfaces specify different return types for their methods (a supposition that I have not yet tested). The only real problem with doing this, however, is that the interfaces may dictate two entirely different (and possibly contradictory) actions.
Best bet is to name your interface methods more distinctly. The method name "move" isn't incredibly descriptive.

Similar Messages

  • Implementing interface with static method?

    Hi,
    I need to implement an interface with a static method. I tried to do it both with the interface method static and non-static, but it don't seam to work! Does it work?
    How can I make a work around?
    Thanks!

    Interfaces are designed to provide a contract that a particular object instance guarantees for it's Clients.
    Since a static method does not relate to any particular object instance there is no contract to define...hence you can't have an interface for static methods...
    What you could do however is return an object via a static method that does provide the implementation of the interface...
    i.e.public class MyClass
        static private String myInterfaceImpl = "<some class>";
        static public MyInterface getInterface ()
             return (MyInterface) MyClass.class.forName (MyClass.myInterfaceImpl).newInstance ();
    }That would return an object that provides the interface. I would presume you need the static method so that you don't have to pass around references to a particular object...this method gets around that...you could also create a single object at start up time and return a reference to that eveytime...
    Also, in a way static methods do define an interface...

  • How to configure one dsl connection and one public ip in cisco router and map to one interface for using exchange server

    how to configure one dsl connection and one public ip in cisco router and map to one interface for using exchange server

    Hi ,
     Have you got any additional public IP Address from your service provider , If yes on router you can have static route for those additional IP Address pointing to your ASA  outside interface . 
    Accordingly you can configure NAT 
    HTH
    Sandy . 

  • EJB3 - More than one remote interface for Session Bean?

    Hi,
    Is it possible in EJB3 to have more than one remote interface for a SessionBean?
    I have seen it posetd on here that it is possible but never been able to find any other information.
    Using JBoss as my App Server, I have deployed an App, where a SessionBean is defined as implementing 2 interfaces, both of which are annotated using @remote.
    However when I examine the JBoss JMX Console, Global JNDI Namespace only one remote interface is listed, and indeed it is the first one defined in the SessionBean.
    Considering I use a String similar to (MyApp/MyBean/remote) to do the JNDI lookup, this would indicate that it is not possible to have more than one remote interface.
    1. Is this a JBoss specific limitation?
    2. Is there another way of performing the JNDI lookup?
    Thanks,
    Alan.

    Hi,
    Thanks for prompt response! I tried the suggestion in my application, and the output from JBoss JMX Console was
    +- XXXBean (class: org.jnp.interfaces.NamingContext)
      |   |   +- remote (proxy: $Proxy291 implements No ClassLoaders found for: xxx.xxx.xxx.xxx.xxx.Remote1 (no security manager: RMI class loader disabled))Again only displaying the remote interface that is first in the @remote ({ Remote1.class , Remote2.class}) list. This would lead me to believe that JBoss does not support this.
    Can anyone confirm this?
    Alan.

  • Creation of one outbound interface for two diferent senders

    helo.
    i just want to conform ont thing that .
    my scenario is  two diferent files from 2 diferent business systems are sending to one Rfc.
    so i was created only one outbound interface for both senders and one message type bcos the file structure is same for both senders.
    so is there any thing wrong in creating only one datatype,message type,message interface for both senders.
    waiting for your response.
    cheers.
    seeta ram.

    Hi Ram,
    That is perfectly correct when you have two senders and one receiver Scenario and <b>Business Service is different</b>. Then you can use the same Interface.
    Just keep in mind that the key for XI to recognise the Right interface is combination of these 3 parameters:
    Sender Service, Sender Interface and Namespace. These cannot be duplicated.
    When the Message type is same in the sender input data then you can create just one Message Type and One Data type and RFC is anyhow the imported RFC which you need not have to worry.
    In Configuration Scenario you need to configure separately the RD, ID, CC and Agreements for the Interfaces.
    Hope this answers your query. Let us know if you need anymore clarification
    Thanks
    Srini

  • Bank Transfer file: generate two outgoing files for one pmt method?

    Hello Experts,
    Two files (header and item) are expected from the hungarian bank for each payement.
    It's possible to generate two outgoing files for one pmt method using DMEE tree? If yes, can you tell me how?
    If not, there is an other solution? Use a classic program (copy and adaptation) for example?
    Thank you in advance.
    Amal

    Are you sure you need separate files file header and items.
    Usually both header and items are placed in the same file. Please reconfirm or get the formats from the Bank.

  • More than one outbound interface for the webservice scenario

    Hi Experts,
    Is it possible to have more than one outbound interface for the Webservice synchronous scenario? I have tried it , but I couldn't implement it.
    I would like to have your suggestions.
    Regards
    Sara

    Hey,
    Creation of a wsdl file
    /people/riyaz.sayyad/blog/2006/05/07/consuming-xi-web-services-using-web-dynpro-150-part-i
    N:1 seemz he was refering to multimapping scenario.
    <b>Cheers,
    *RAJ*
    *REWARD POINTS IF FOUND USEFULL*</b>

  • Different payment method for one invoice

    Hello everyone
    Is it possible to have multiple payment method for one invoice? As my client want to pay different payment method for one invoice.
    Could you please advise?
    Kind regards

    Yes. You can provided if you split the invoice amount into multiple payments under scheduled payments tab in invoice workbench.

  • How to set transaction isolation level for a method in a Local Interface

              By reference at:
              http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              the value for method-intf can only be "Remote" or "Home".
              My question is--
              How to set transaction isolation level for a method inside a Local Interface or
              Local_Home Interface?
              Thanks.
              Xing
              

    I'd try 6.1SP2. I'm pretty sure this works now.
              -- Rob
              Xing wrote:
              > I tried "Local", but got an error when deploying the EJB jar, saying that only
              > "Remote" or "Home" is allowed.
              >
              > Any idea?
              >
              > Xing
              >
              > Rob Woollen <[email protected]> wrote:
              > >
              > >
              > >Use LocalHome or Local.
              > >
              > >-- Rob
              > >
              > >Xing wrote:
              > >
              > >> By reference at:
              > >> http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > >> the value for method-intf can only be "Remote" or "Home".
              > >>
              > >> My question is--
              > >>
              > >> How to set transaction isolation level for a method inside a Local
              > >Interface or
              > >> Local_Home Interface?
              > >>
              > >> Thanks.
              > >>
              > >> Xing
              > >
              > >--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com
              > >
              > >
              > >
              > >
              > ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              > ><html>
              > >Use LocalHome or Local.
              > ><p>-- Rob
              > ><p>Xing wrote:
              > ><blockquote TYPE=CITE>By reference at:
              > ><br>http://e-docs.bea.com/wls/docs61/ejb/reference.html#1071267,
              > ><br>the value for method-intf can only be "Remote" or "Home".
              > ><p>My question is--
              > ><p>How to set transaction isolation level for a method inside a Local
              > >Interface
              > >or
              > ><br>Local_Home Interface?
              > ><p>Thanks.
              > ><p>Xing</blockquote>
              > >
              > ><pre>--
              > >
              > >----------------------------------------------------------------------
              > >
              > >AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              > >
              > >by Michael Girdley, Rob Woollen, and Sandra Emerson
              > >
              > >http://learnWebLogic.com</pre>
              > > </html>
              > >
              > >
              AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
              by Michael Girdley, Rob Woollen, and Sandra Emerson
              http://learnWebLogic.com
              [att1.html]
              

  • How to check owner for one interface in production system?

    Hello All,
    Please tell me the transaction were i can check owner for one interface in production system.
    Client had created owner for one interface, so were can i check it.
    Thanks and Regards,
    Chinna

    Thanks for the reply,
    i dont want to check the developer name in IR /ID.
    in production system one interface is running and i got mail to check the  generic user and role for that interface.
    iam also bit confused on it
    If u have any idea let me know.
    Thanks and regards,
    chinna

  • Hi all, i need to create a one method in assistance class for updating the custom table.

    Req as follows : 
    1. i need to create one method in a assistance calss  for updating custom table .
    2. now i  have to pass the multiple entries to that table then inside the method based need to update the Ztable. based on this entries
    3. My internal table is having 2 fields ( Customernumber (key field) , Shiftloc ).(Multiple entries ex : 500)
       based on customernumber need to update the new shiftloc in my custom table.
    Can any one give some inputs please. i have doubt can we pass mupltiple entries (internal) as a importing parameter to the method?
    Cheers,
    Venu

    Hi rama,
    thank you for your promt reply.
    i have one more query. Here i need to update the only Shipt to adress for particular customer number.
    i have written the code as below. Please clarify this code will work for my requirement.
       method UPDATE_SHIPTO.
      data : Lt_contract type ty_update_shipto_t.
      data : ls_contract like line of  Lt_contract .
      REFRESH : Lt_contract.
      lt_contract[] = LT_DATA[].
      loop at lt_contract into ls_contract.
    *    update  Zcustom  SET ship_to_adress  = ls_contract-new_bp
                                 WHERE  cust_no = ls_contract-custnum
        CLEAR : ls_contract.
      ENDLOOP.
    COMMIT WORK.
    endmethod.

  • Different consolidation methods for one entity on one scenario

    Dear experts,
    How can I have different consolidation methods for one entity on one scenario?
    One entity is going from proportionate to equity method. We would like to check variations due to this change.
    Best regards,
    Benoit

    Hi Benoit,
    How's things?
    Managing the consolidation methods is based on the setup of your consolidation rules.
    However, the first place that you should look is the Ownership Management. Select the parent of the entity that you work to process. In the screen, you will be able to see the available methods and the ownership. All these settings are related with the consolidation rules available in your application.
    Regards,
    Thanos
    < spam signature link removed by moderator >

  • Two auto-reaction methods for one alert

    Hi,
    I wonder if it is possible to trigger 2 auto-reaction methods for one alert.
    The 2 methods  (tc RZ21) we want to use are :
    1) Trigger a SNMP trap with method : CCMS_OnAlert_SNMP_TRAP
    2) Trigger a Mail with method : ccms_send_alert_to_alm_ccms_container_v4
    Those 2 templates are working fine if we use them separately.
    I want to use them both for the same alert.
    Are there methods, function module, reports,... available to handle this?
    Hope somebody can help.
    Regards
    Paul Van Daele

    Found the solution :
    Note 727584 - CCMS : Triggering several auto-reaction methods for an alert

  • Any one programed a serial interface for the Yaesu gs-232 antenna rotator

    Has any one tried to make a simple interface for this device? I have done some basic communicating with it, but it seems to be rather glitchy.

    Thanks that helped out a lot; I combined that program with the serial example. It works well, but it seems to want to update very frequently, as I am hearing relays tripping, but if I set the number I want and hit stop it goes there and will stop at that command. Is there a way to just have it send the data and then just have it leave the serial device alone unless you change the angle. As in only send the data once, but not have to re hit run.
    Attachments:
    GS-232 Controler.vi ‏37 KB

  • Using one Message Interface for all mappings

    Hi Folks,
    I am using a BPM in which i m getting a file from file system which have system ID in it.
    I am having three send Synchronous step following that.
    What i need is to use the Message interface for file to be used for receiver determination based on system id in case of Synchronous interfaces.
    DO i need to include this File msg. interface in each mapping, if i do so will it be possible to send req. and get response for synchronous call.
    OR is there any way to to use the file msg. interface for each mapping.
    we are on SP17,I also tried Extended mapping but i am having SYNCHRONOUS send steps.
    Plz help me out
    Sachin

    Bhavesh
    <i>1. You receiver a file in your BPM . This has a field called SYSTEM ID?
    2. On the basis of the System ID field you need to determine the Receiver to which the Synchronous Request message has to be sent?</i>
    Sorry for that...because I was confused with jai's ans.. that's why said like that
    <b>You are absolutely correct</b>
    This is what i want to do.
    i can't use switch step here.  my BPM looks like this
    RecFile->sync send->transformation1->transformation2->sync send2->transformation3->BLOCK
    in BLOCK
    Sync Send3->transformation4 and so on...
    I am using three different Sync ABS Interface for each Sync send steps.
    In receiver determination i want to get the data from respective R/3 system based on system ID i.e. logical system in File MI.
    Say if it T90CLNT90 then get data from BS_SAPR3_4.6 else from BS_4.7
    Sachin
    Message was edited by:
            Sachin Dhingra

Maybe you are looking for

  • How do i change my user name on my icloud account

    How can i change my icloud account user name on my iphone 4s

  • Adobe PDF Document error pop ups while web surfing

    I have a strange issue with either Adobe Reader or Adobe Acrobat. Randomly while looking at websites or loading a website an Adobe error pops up that says, "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a Web Browser.

  • RFC_READ_TABLE dump while reading T006- Urgent

    Hi, I am using fm RFC_READ_TABLE ( cloned copy) to get values from another client. But while accessing T006 table it is giving following dump. Error Analysis In the current program "SAPLSDTX", an ASSIGN statement is supposed to          assign a fiel

  • IWeb SEO Tool

    Hello. I'm trying to use this software. I need to import my site from this location HD/Users/Max/Sites to be able to use this sw. This folder is NOT updated with the last changes, so the whole operation is not useful. Any idea?

  • After deleting photos, memory in my iPad is still used. WHY?

    When connecting my iPad mini to iTunes on my MacBook Air it shows that I have 2489 pictures on the iPad and am using 28.4 GB for all those pictures. When I open the Photos app on my iPad it shows that I do not have ANY pictures on the iPad, which wou