Implementation of method

hi Frnds,
i have got a class which is having a interface method. I want to implement that method in that class only. but when i Double Click on it then it is showing that it is implementated in a different class.
how can i implement it in that class only.
Thanks
Rohit

Hi ROHIT,
when i double click on the interface it shows me that it is implemented in the superclass
As interface is always implemented in public section of a class, it is already implemented in all its subclasses. Therefore you already have the implementation done. As my predecessors said you cannot control were it is implemented (besides your implementation), but you can redefine it. It will then have a different implementation than it has in superclass. Without this your class cannot impelemnt it once again as name conflict would arise. This is because you already have one implementation of that interface method in you public section (made in supperclass).
Hope this is clear
Marcin

Similar Messages

  • Implements interface method at the derived class

    Hi all.
    I have a class (Derived) that extends another class (Base).
    In the base class (Base) there is a method f() with its implementation.
    In the interface (C) there is also f() method exactlly like in the base class (Base).
    The derived class (Derived) is implements the interface (C).
    My question is:
    Do i have to implement the method f() in the derived class (Derived) ?

    My guess is that you probably have to, even if it's just to call the parent's method.
    This all sounds pretty sketchy. Why don't you just make the BASE class implement your interface?

  • How i can implement onPageLoad method in ADf Fusion Middleware

    I want to implement onPageLoad method in ADF Fusion Middleware. What i did so far is :
    - Created my own PagePhaseListener class which implements PagePhaseListener interface.
    I wrote following code in that class
    public void afterPhase(PagePhaseEvent event) {
    PageLifecycleContext ctx = (PageLifecycleContext)event.getLifecycleContext();
    if (event.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
    BindingContainer bc = ctx.getBindingContainer();
    onPagePreRender();
    bc = null;
    public void onPageLoad() {
    // Subclasses can override this.
    public void onPagePreRender() {
    // Subclasses can override this.
    public void beforePhase(PagePhaseEvent event) {
    PageLifecycleContext ctx = (PageLifecycleContext)event.getLifecycleContext();
    if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
    BindingContainer bc = ctx.getBindingContainer();
    onPageLoad();
    bc = null;
    - Created a backingbean with session scope and override onPageLoad method
    - Inside pageDefinition i added Controller class using EL like #{MyPhaseListenerBean}
    but it game me error that no "MyPhaseListenerBean class found.

    Hi ,
    When am Adding ControllerClass ( ControllerClass="com.hp.rebates.grs.view.backing.fragments.ItemTabsBean" ) for PageDef File am getting error as...
    <[ServletContext@31287410[app:grs module:grs-ViewController-context-root path:/grs-ViewController-context-root spec-version:2.5 version:V2.0]] Servlet failed with Exception
    java.lang.ClassCastException: com.hp.rebates.grs.view.backing.fragments.ItemTabsBean cannot be cast to oracle.adf.model.RegionController
    at oracle.adf.model.binding.DCBindingContainer.getRegionController(DCBindingContainer.java:4944)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.doRegionRefresh(TaskFlowRegionController.java:225)
         at oracle.adf.controller.internal.binding.TaskFlowRegionModel.processBeginRegion(TaskFlowRegionModel.java:117)
         at oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange.doChangeImpl(UIXRegion.java:1182)
         at oracle.adf.view.rich.context.DoableContextChange.doChange(DoableContextChange.java:91)
         Truncated. see log file for complete stacktrace
    >
    Any one can help me solve this issue.
    Thanks in Advance.

  • Do I have to implement "Call" method of SOAPConnection object?

    I was trying the example "saaj-simple" that comes with "jwsdp".
    But it gave me NoSuchMethodError for the method "call" of "SOAPConnection" object.
    I opened the "saaj-api.jar" and found that the "call" method is abstract.
    Am I supposed to be implementing this method? I thought I should be using this method as it is.

    Yup! I already have that.
    In fact I have both the jars associated with SAAJ plus other jars related to javax.
    But still it ain't working. It gives runtime error.
    It compiled successfully.

  • I need  to implement clone method  in theAdvancedDataGrid class

    I need  to implement clone method  in theAdvancedDataGrid class, to copy the object in its completeness   Could anyone give me a helping hand.

    Hi Nikos,
    from youe question it's not clear what do you need to copy: data, parts of ADG (GUI) or something else?
    If it's not a GUI - only data - you can use mx.utils.ObjectUtil.copy(value:Object):Object

  • [svn] 1074: Fix test case to implement new method in IXMLEncoder

    Revision: 1074
    Author: [email protected]
    Date: 2008-04-02 13:00:45 -0700 (Wed, 02 Apr 2008)
    Log Message:
    Fix test case to implement new method in IXMLEncoder
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/dec oder/SOAPEncoderTestCase.as

    Year           Is Leab Year?
    1           no      
    4            yes
    1580            yes
    1582           no      
    1584            yes      
    1600            yes      
    1700            no      
    1800            no      
    1900            no      
    1996            yes      
    1997           no      
    1999            no      
    2000            yes      
    2100            no      
    2200            no      
    2300            no      
    2400            yes      
    2800            yes      
    2900            no      
    3200            yes      
    3300            no      
    3600            yes      
    3800            no      
    4000            yes      
    4200            no      
    4400            yes      
    4700            no      
    4800            yes      
    5100            no      
    5200            yes      
    6400            yes      
    6500            no      
    6800            yes      
    6900            no      
    7200            yes      
    7400            no      
    7600            yes      
    7800            no           

  • Implementation of methods is not available

    Sorry for my naivity folks: what exactly does "implementation of methods is not available" mean in a Java source code? Does it mean the implentation has been compiled? thanks

    Actually the problem I'm facing is that I'm looking at
    the Java class with certain methods not 'well
    defined'.. eg
    // Methods
    public int getTimerCounterNumber() { }
    public boolean waveformModuleExists() { }
    public WaveformModule getWaveformModule() { }
    public void setTriggerClearInterruptEnabled(boolean
    n p0) { }
    That isn't valid java. So either you are not seeing that or you are not looking at java.
    Interfaces do not have method bodies (which your example does.) Perhaps that is what you are looking at.

  • Implementation of methods in Iterations

    Where does implementation of methods in Iteration interfact take place. For example methods such as hasMoreElements && so on .
    Thxs
    satish

    Methods defined in an Interface will be implemented by 'Implementing Classes'.
    Have a look at java docs to findout these implementing classes.
    For example Enumeration's hasMoreElements() and nextElement() are implemented in StringTokenizer class.
    Sudha

  • Ow can i implement some method to perform task even if the user close

    Dear All
    I have a process need long time to complete , now how can i implement some method to perform this task even if the user close the browser??
    e.g
    if i have a button to update some value on one million recode which will take about 1 hour, is there a way to complete this update even if the user close his browser?

    Jaber,
    Sure, that works just fine too (having a Java application running). In order to "notify" it to run something, you can use whatever technology you like; if I were doing it, I'd probably use something like JMS backed by Oracle AQ to queue up tasks for it to do, however, that's just personal preference. You would have to design something that meets the needs of your particular use case. Perhaps another way would be to run it as a database job, in which case you can use the database scheduler to run it. There are probably one million and four different ways of doing it - the one you choose would depend upon your requirements and the technology you are comfortable with.
    John

  • Force Derived Class to Implement Static Method C#

    So the situation is like, I have few classes, all of which have a standard CRUD methods but static. I want to create a base class which will be inherited so that it can force to implement this CRUD methods. But the problem is, the CRUD methods are static. So
    I'm unable to create virtual methods with static (for obvious reasons). Is there anyway I can implement this without compromising on static.
    Also, the signature of these CRUD methods are similar.
    E.g. ClassA will have CRUD methods with these type of Signatures
    public static List<ClassA> Get()
    public static ClassA Get(int ID)
    public static bool Insert(ClassA objA)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    ClassB will have CRUD signatures like
    public static List<ClassB> Get()
    public static ClassB Get(int ID)
    public static bool Insert(ClassB objB)
    public static bool Update(int ID)
    public static bool Delete(int ID)
    So I want to create a base class with exact similar signature, so that inherited derived methods will implement their own version.
    For E.g. BaseClass will have CRUD methods like
    public virtual static List<BaseClass> Get()
    public virtual static BaseClassGet(int ID)
    public virtual static bool Insert(BaseClass objBase)
    public virtual static bool Update(int ID)
    public virtual static bool Delete(int ID)
    But the problem is I can't use virtual and static due to it's ovbious logic which will fail and have no meaning.
    So is there any way out?
    Also, I have few common variables (constants) which I want to declare in that base class so that I don't need to declare them on each derived class. That's why i can't go with interface also.
    Anything that can be done with Abstract class?

    Hi,
    With static methods, this is absolutely useless.
    Instead, you could use the "Singleton" pattern which restrict a class to have only one instance at a time.
    To implement a class which has the singleton pattern principle, you make a sealed class with a private constructor, and the main instance which is to be accessed is a readonly static member.
    For example :
    sealed class Singleton
    //Some methods
    void Method1() { }
    int Method2() { return 5; }
    //The private constructor
    private Singleton() { }
    //And, most importantly, the only instance to be accessed
    private static readonly _instance = new Singleton();
    //The corresponding property for public access
    public static Instance { get { return _instance; } }
    And then you can access it this way :
    Singleton.Instance.Method1();
    Now, to have a "mold" for this, you could make an interface with the methods you want, and then implement it in a singleton class :
    interface ICRUD<BaseClass>
    List<BaseClass> GetList();
    BaseClass Get(int ID);
    bool Insert(BaseClass objB);
    bool Update(int ID);
    bool Delete(int ID);
    And then an example of singleton class :
    sealed class CRUDClassA : ICRUD<ClassA>
    public List<ClassA> GetList()
    //Make your own impl.
    throw new NotImplementedException();
    public ClassA Get(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Insert(ClassA objA)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Update(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    public bool Delete(int ID)
    //Make your own impl.
    throw new NotImplementedException();
    private CRUDClassA() { }
    private static readonly _instance = new CRUDClassA();
    public static Instance { get { return _instance; } }
    That should solve your problem, I think...
    Philippe

  • How to implement find methods in CMP?

    As OC4J does not support EJB-QL, we need to implement the find methods by ourselves. But how? Here is my thought.
    1) Still declare the find methods in EJB home, such as
    public Collection findBySponsor(String sponsorGuid);
    2) Do not add query part to ejb-jar.xml file;
    3) In the bean class, implement the find method using JDBC code.
    Does CMP allows explicit-implementation of finder methds?
    Does CMP allows explicit-call to JDBC code?
    Thanks,

    Henry -- Why go to that trouble? For the near term I would suggest that you just modify the generated
    orion-ejb-jar.xml descriptors which will include tags to allow you to either 1) enter a partial criteria or
    2) enter a complete SQL statement. This is much less work and when EJB-QL is available with the product,
    then you have to only add the EJB-QL to the ejb-jar.xml.
    Thanks -- Jeff

  • SOAP Implementation missing methods

    Hello,
    I am developing a document based SOAP web service and I wish to add a
    DOM Document to the SOAP Body. Looking at the Java 2 Platform
    Enterprise Edition 1.4 specification on the Sun web site I have found
    the following method "public SOAPBodyElement addDocument(Document
    document)", which does exactly what I require. Although when I attempt
    to call this method I get the following exception:
    java.lang.AbstractMethodError:
    weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
    Has this method not been implemented in Weblogic 8.1? Any suggestions
    would be very much appreciated.
    Thanks, Stuart

    Hi Stuart,
    The addDocument(org.w3c.dom.Document) method was introduced in SAAJ 1.2. The SAAJ
    implementation in WLS 8.1 is version 1.1. SAAJ 1.2 will be supported in a future
    service pack or release.
    For now, you can still achieve what it sounds like you want to do (i.e. send the
    XML contained in an org.w3c.dom.Document to a "document-style" web service, as
    the immediate child element of the <SOAP-ENV:Body> element, in the SOAP request
    message), using the javax.xml.rpc.Call object. You just need to call the setProperty(Call.OPERATION_STYLE,
    "document") method, on the Call object you create in your web service consumer
    code. You don't have to do this with a Stub model web service consumer, because
    the WSDL will (or should) have a style="document" attribute, on the <soap:binding>
    element :-)
    Regards,
    Mike Wooten
    Stuart Williamson <[email protected]> wrote:
    Hello,
    I am developing a document based SOAP web service and I wish to add a
    DOM Document to the SOAP Body. Looking at the Java 2 Platform
    Enterprise Edition 1.4 specification on the Sun web site I have found
    the following method "public SOAPBodyElement addDocument(Document
    document)", which does exactly what I require. Although when I attempt
    to call this method I get the following exception:
    java.lang.AbstractMethodError:
    weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
    Has this method not been implemented in Weblogic 8.1? Any suggestions
    would be very much appreciated.
    Thanks, Stuart

  • Implements the method defined in interface

    I defined a interface such as
    interface IAuthorizer{
    boolean checkPermission(Set<IAttribute> subj, Set<IAttribute> Permission);
    In java 5, why does compiler not accept the method checkPermission signature of the following class
    class Auth1 implements IAuthorizer{
    boolean checkPermission(Set<IAttribute> subj, Set<IAttribute> Permission){
    Iclass Auth1 implements IAuthorizer{
    boolean checkPermission(Set subj, Set Permission){
    nstead, the compiler only accepts

    <If you compile the interface and the class in the same time (eg not having the interface in a jar file against which to compile the class), the compiler should accept your code.>
    The interface and class is even in the same package. The compiler does not accept method signature as
    boolean checkPermission(Set<IAttribute> subj, Set<IAttribute> perms)
    <If your interface is part of a library jar file, could it be that
    - the library is obfuscated using an obfuscater that doesn't know about generics?
    - the class is written against JDK 1.4 API (in which Set is not generic)?
    - the class is compiled using java 1.4 compiler?
    >
    no library is involved in the issue.
    class is written in JDK 1.5 API and use JDK 1.5 compiler.

  • Implementation for Method not available

    Hi
    I have installed Weblogic 5.1 with Sp 12 in Solaris 2.8.
    I wrote an Java application which connects to a Oracle
    Database using Weblogic JDriver. I used jdbc20 Driver
    available under Weblogic. When I try to execute any of
    the JDBC2.0 Spec methods like updateRow() I get an exception
    saying "the JDBC2.0 method is not implemented". What could
    be the problem?
    Thanks & Regards
    Ramkumar

    Hi Ramkumar,
    Not all JDBC 2.0 methods are implemented in this driver, you can check out
    the list of available methods in the WLS docs online. I suggest using the
    thin driver.
    sree
    "Ramkumar" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi
    I have installed Weblogic 5.1 with Sp 12 in Solaris 2.8.
    I wrote an Java application which connects to a Oracle
    Database using Weblogic JDriver. I used jdbc20 Driver
    available under Weblogic. When I try to execute any of
    the JDBC2.0 Spec methods like updateRow() I get an exception
    saying "the JDBC2.0 method is not implemented". What could
    be the problem?
    Thanks & Regards
    Ramkumar

  • Implementing abstract methods

    Hello guys,
    I have a LPQueue class that implements a interface PQueue
    Here are the fiels:
    //PQueue interface
    import java.util.Iterator;
    interface PQueue<E extends Comparable<E>>
      public void insert(E x);
      public E peekMax();
      public E deleteMax();
      public int size();
      public void clear();
      public Iterator<E> iterator();
    //LPQueue class
    import java.util.*;
    import java.util.Iterator;
    public class LPQueue<E extends Comparable<E>> implements PQueue<E>
         private Node<E> first;
         private int size;
         public LPQueue(){
              first = null; //pointing to the first element
              size = 0;
         public void insert(E x){
              Node <E> tmp = new Node<E>(x);
              size++; //when we call insert we want to increase size by one to keep the size of queue current
              Node <E> p = first; //p points to first element
              Node <E> q = null; //this points to null initially because q has to stay behind p
              while(p != null && x.compareTo(p.data) > 0){
                   q = p;
                   p = p.next;
              if(q == null){
                   tmp.next = first;
                   first = tmp;
              else{
                   tmp.next = p;
                   q.next = tmp;
         public E peekMax(E x){
              if(size == 0){
                   throw new NoSuchElementException();
              if(x.compareTo(first.data) > 0){
                   return x;
              }else return first.data;
         public E deleteMax(E x){
              Node <E> tmp;
              if(size == 0){
                   throw new NoSuchElementException();
              if(x.compareTo(first.data) > 0){
                   first.data = null;
                   return x;
              }else
                   tmp = first;
                   first.data = null;
              return tmp.data;
         public int size(){
              return size;
         public void clear(){
              size = 0;
              first = null;
         public Iterator<E> iterator()
             return new LQIterator();
         private class LQIterator implements Iterator<E>{
              public Node<E> current;
              private LQIterator()
                  current = first;
                public boolean hasNext()
                    return current !=null;
                public E next()
                    if(!hasNext()){
                        throw new NoSuchElementException();
                    E x = current.data;
                    current = current.next;
                    return x;
                public void remove()
                    throw new UnsupportedOperationException();
         //seting up static Node class
         private static class Node <E>{
              public E data; //seting up paramtere data for node
              public Node<E> next; //
              public Node(E x){ //sting up constructor for Node passing the paramter x to data
                   data = x;
    }When i try to compile i get :
    The type LPQueue<E> must implement the inherited abstract method PQueue<E>.deleteMax() LPQueue.java
    The type LPQueue<E> must implement the inherited abstract method PQueue<E>.peekMax() LPQueue.java
    I have written the definition for both the peekMax and deletMax methods why am i still getting the above error?
    Thank you for your help,
    -Lovac

    The method signatures of the interface must match up exactly with the implementing classes. In the interface, neither method signature accepted a parameter, but in your concrete class, they do, and this just won't work.

Maybe you are looking for

  • Merging of 2 Cells in WD ABAP ALV Header & Dynamically change the header

    Hello Experts, I have two main requirements with respect to WD ABAP - ALV report creation 1) Two feilds in the  header of ALV GRID created in the WD ABAP screen must be merged as shown below(Month Column) , |     January         |     February       

  • ESS Customization.

    Hi , I have customized Serive files for PZ12 ( family and related persons ) . and it's working fine . I did deleteion of some fields and addition of few . I hav modified the BAPI's which are used to fetch rec's from relevant infotype . Later i found

  • Error during backup!

    I have getting errors with the last 3 versions of PC Suite when trying to make a full backup. It seems like it won't backup my calender. It says my calender is in use. I DO have data in the calender. I have no 3rd party calender installed. Doesn't PC

  • Install leopard in ibook g4

    I have all the requirement for install new leopard software, hd drive space 9.08 but when install the cd it show that I have 8.3 instead and needs 8.8. That confuse me and I erase everything what i don't need. I think there might be some else i can e

  • Pb mise a jour

    Depuis la derniere mise a jour, iphoto ne fonctionne plus . Sur macbook pro OSX 10.9 pourriez-vous m'aider