implement problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Irlan agous

    #1

    implement problem




    I have an claass that implements another one

    public class PatientImpl extends UnicastRemoteOb ject implements
    PatientInterfac e


    In PatientInterfac e, i have this class


    public interface PatientInterfac e extends Remote
    {

    public String getPatientNumme r() throws RemoteException ;
    public String getSofiNummer() throws RemoteException ;
    public String getVerzekerings Ma() throws RemoteException ;
    public String getPolisNummer( ) throws RemoteException ;
    public String getNaam() throws RemoteException ;
    public String getAdres() throws RemoteException ;
    public String getPostCode() throws RemoteException ;
    public String getWoonplaats() throws RemoteException ;
    public String getGebDatum() throws RemoteException ;

    }


    But i get this error message when i want to implement the interface

    PatientImpl.jav a [11:1] PatientImpl is not abstract and does not override
    abstract method getPostCode() in PatientInterfac e

    What is wrong here?


  • Raymond DeCampo

    #2
    Re: implement problem

    Irlan agous wrote:[color=blue]
    > I have an claass that implements another one
    >
    > public class PatientImpl extends UnicastRemoteOb ject implements
    > PatientInterfac e
    >
    >
    > In PatientInterfac e, i have this class
    >
    >
    > public interface PatientInterfac e extends Remote
    > {
    >
    > public String getPatientNumme r() throws RemoteException ;
    > public String getSofiNummer() throws RemoteException ;
    > public String getVerzekerings Ma() throws RemoteException ;
    > public String getPolisNummer( ) throws RemoteException ;
    > public String getNaam() throws RemoteException ;
    > public String getAdres() throws RemoteException ;
    > public String getPostCode() throws RemoteException ;
    > public String getWoonplaats() throws RemoteException ;
    > public String getGebDatum() throws RemoteException ;
    >
    > }
    >
    >
    > But i get this error message when i want to implement the interface
    >
    > PatientImpl.jav a [11:1] PatientImpl is not abstract and does not override
    > abstract method getPostCode() in PatientInterfac e
    >
    > What is wrong here?
    >[/color]

    Exactly what the compiler says. Either PatientImpl should be declared
    abstract (probably not what you want) or PatientImpl should contain an
    implementation of the getPostCode() method declared in the
    PatientInterfac e interface.

    Ray

    --
    XML is the programmer's duct tape.

    Comment

    • Irlan agous

      #3
      Re: implement problem

      Thanks

      But the PatientInterfac e is not abstract, and how do i implement a method,
      why cant i declate the whole interface if its not abstract?

      Irlan
      "Raymond DeCampo" <nospam@twcny.r r.com> schreef in bericht
      news:jiZpe.1586 5$HT1.15826@twi ster.nyroc.rr.c om...[color=blue]
      > Irlan agous wrote:[color=green]
      >> I have an claass that implements another one
      >>
      >> public class PatientImpl extends UnicastRemoteOb ject implements
      >> PatientInterfac e
      >>
      >>
      >> In PatientInterfac e, i have this class
      >>
      >>
      >> public interface PatientInterfac e extends Remote
      >> {
      >>
      >> public String getPatientNumme r() throws RemoteException ;
      >> public String getSofiNummer() throws RemoteException ;
      >> public String getVerzekerings Ma() throws RemoteException ;
      >> public String getPolisNummer( ) throws RemoteException ;
      >> public String getNaam() throws RemoteException ;
      >> public String getAdres() throws RemoteException ;
      >> public String getPostCode() throws RemoteException ;
      >> public String getWoonplaats() throws RemoteException ;
      >> public String getGebDatum() throws RemoteException ;
      >>
      >> }
      >>
      >>
      >> But i get this error message when i want to implement the interface
      >>
      >> PatientImpl.jav a [11:1] PatientImpl is not abstract and does not override
      >> abstract method getPostCode() in PatientInterfac e
      >>
      >> What is wrong here?[/color]
      >
      > Exactly what the compiler says. Either PatientImpl should be declared
      > abstract (probably not what you want) or PatientImpl should contain an
      > implementation of the getPostCode() method declared in the
      > PatientInterfac e interface.
      >
      > Ray
      >
      > --
      > XML is the programmer's duct tape.[/color]


      Comment

      • Raymond DeCampo

        #4
        Re: implement problem

        Please do not top post after the reply has been bottom posted.

        Irlan agous wrote:[color=blue]
        > Thanks
        >
        > But the PatientInterfac e is not abstract, and how do i implement a method,[/color]

        This seems like a very basic question; perhaps English is not your
        native language?

        A programmer implements a method by including a body for the method in
        the Java source file. For example:

        public class PatientImpl extends UnicastRemoteOb ject
        implements PatientInterfac e
        {
        private String postCode;

        // What follows is the implementation of the getPostCode()
        // method.
        public String getPostCode()
        {
        return postCode;
        }
        }
        [color=blue]
        > why cant i declate the whole interface if its not abstract?[/color]

        I'm sorry I do not understand this question.
        [color=blue]
        >
        > Irlan
        > "Raymond DeCampo" <nospam@twcny.r r.com> schreef in bericht
        > news:jiZpe.1586 5$HT1.15826@twi ster.nyroc.rr.c om...
        >[color=green]
        >>Irlan agous wrote:
        >>[color=darkred]
        >>>I have an claass that implements another one
        >>>
        >>>public class PatientImpl extends UnicastRemoteOb ject implements
        >>>PatientInter face
        >>>
        >>>
        >>>In PatientInterfac e, i have this class
        >>>
        >>>
        >>>public interface PatientInterfac e extends Remote
        >>>{
        >>>
        >>> public String getPatientNumme r() throws RemoteException ;
        >>> public String getSofiNummer() throws RemoteException ;
        >>> public String getVerzekerings Ma() throws RemoteException ;
        >>> public String getPolisNummer( ) throws RemoteException ;
        >>> public String getNaam() throws RemoteException ;
        >>> public String getAdres() throws RemoteException ;
        >>> public String getPostCode() throws RemoteException ;
        >>> public String getWoonplaats() throws RemoteException ;
        >>> public String getGebDatum() throws RemoteException ;
        >>>
        >>>}
        >>>
        >>>
        >>>But i get this error message when i want to implement the interface
        >>>
        >>>PatientImpl. java [11:1] PatientImpl is not abstract and does not override
        >>>abstract method getPostCode() in PatientInterfac e
        >>>
        >>>What is wrong here?[/color]
        >>
        >>Exactly what the compiler says. Either PatientImpl should be declared
        >>abstract (probably not what you want) or PatientImpl should contain an
        >>implementatio n of the getPostCode() method declared in the
        >>PatientInterf ace interface.
        >>
        >>Ray
        >>
        >>--
        >>XML is the programmer's duct tape.[/color]
        >
        >
        >[/color]

        Ray

        --
        XML is the programmer's duct tape.

        Comment

        • Irlan agous

          #5
          Re: implement problem

          Thanks for the pointers!
          You are right, english is not my native language. its dutch actually, hehe.

          why cant i declate the whole interface if its not abstract?

          I'm sorry I do not understand this question.

          What i mean by this question is.
          PatienInterface is declared like this

          public interface PatientInterfac e extends Remote

          I dint declare it as an abstract class, so why does it give me the roor
          message that it cant implement an ebstrat method from the interface class
          It may be a newbie question, sorry, i want to get off this title.hehe

          Thanks
          Irlan

          Irlan
          [color=blue]
          > Irlan agous wrote:[color=green]
          >> Thanks
          >>
          >> But the PatientInterfac e is not abstract, and how do i implement a
          >> method,[/color]
          >
          > This seems like a very basic question; perhaps English is not your native
          > language?
          >
          > A programmer implements a method by including a body for the method in the
          > Java source file. For example:
          >
          > public class PatientImpl extends UnicastRemoteOb ject
          > implements PatientInterfac e
          > {
          > private String postCode;
          >
          > // What follows is the implementation of the getPostCode()
          > // method.
          > public String getPostCode()
          > {
          > return postCode;
          > }
          > }
          >[color=green]
          >> why cant i declate the whole interface if its not abstract?[/color]
          >
          > I'm sorry I do not understand this question.
          >[color=green]
          >>
          >> Irlan
          >> "Raymond DeCampo" <nospam@twcny.r r.com> schreef in bericht
          >> news:jiZpe.1586 5$HT1.15826@twi ster.nyroc.rr.c om...
          >>[color=darkred]
          >>>Irlan agous wrote:
          >>>
          >>>>I have an claass that implements another one
          >>>>
          >>>>public class PatientImpl extends UnicastRemoteOb ject implements
          >>>>PatientInte rface
          >>>>
          >>>>
          >>>>In PatientInterfac e, i have this class
          >>>>
          >>>>
          >>>>public interface PatientInterfac e extends Remote
          >>>>{
          >>>>
          >>>> public String getPatientNumme r() throws RemoteException ;
          >>>> public String getSofiNummer() throws RemoteException ;
          >>>> public String getVerzekerings Ma() throws RemoteException ;
          >>>> public String getPolisNummer( ) throws RemoteException ;
          >>>> public String getNaam() throws RemoteException ;
          >>>> public String getAdres() throws RemoteException ;
          >>>> public String getPostCode() throws RemoteException ;
          >>>> public String getWoonplaats() throws RemoteException ;
          >>>> public String getGebDatum() throws RemoteException ;
          >>>>
          >>>>}
          >>>>
          >>>>
          >>>>But i get this error message when i want to implement the interface
          >>>>
          >>>>PatientImpl .java [11:1] PatientImpl is not abstract and does not
          >>>>override abstract method getPostCode() in PatientInterfac e
          >>>>
          >>>>What is wrong here?
          >>>
          >>>Exactly what the compiler says. Either PatientImpl should be declared
          >>>abstract (probably not what you want) or PatientImpl should contain an
          >>>implementati on of the getPostCode() method declared in the
          >>>PatientInter face interface.
          >>>
          >>>Ray
          >>>
          >>>--
          >>>XML is the programmer's duct tape.[/color]
          >>
          >>
          >>[/color]
          >
          > Ray
          >
          > --
          > XML is the programmer's duct tape.[/color]


          Comment

          • Raymond DeCampo

            #6
            Re: implement problem

            Irlan agous wrote:[color=blue]
            > Thanks for the pointers!
            > You are right, english is not my native language. its dutch actually, hehe.[/color]

            OK, it helps to know that. I will point out that your English is better
            than my Dutch, so we should probably stick to English anyway. :-)
            [color=blue]
            >
            > why cant i declate the whole interface if its not abstract?
            >
            > I'm sorry I do not understand this question.
            >
            > What i mean by this question is.
            > PatienInterface is declared like this
            >
            > public interface PatientInterfac e extends Remote
            >
            > I dint declare it as an abstract class, so why does it give me the roor
            > message that it cant implement an ebstrat method from the interface class
            > It may be a newbie question, sorry, i want to get off this title.hehe
            >[/color]

            When a class implements an interface one of two conditions must be met.
            Either
            i) the class provides implementations for every method declared in the
            interface, or
            ii) the must be declared abstract.

            HTH,
            Ray

            --
            XML is the programmer's duct tape.

            Comment

            Working...