Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

implement problem

Thread view: 
Irlan agous - 09 Jun 2005 13:09 GMT
I have an claass that implements another one

public class PatientImpl extends UnicastRemoteObject implements
PatientInterface

In PatientInterface, i have this class

public interface PatientInterface extends Remote
{

   public String getPatientNummer() throws RemoteException;
   public String getSofiNummer() throws RemoteException;
   public String getVerzekeringsMa() 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 PatientInterface

What is wrong here?
Raymond DeCampo - 09 Jun 2005 16:32 GMT
> I have an claass that implements another one
>
[quoted text clipped - 24 lines]
>
> 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
implementation of the getPostCode() method declared in the
PatientInterface interface.

Ray

Signature

XML is the programmer's duct tape.

Irlan agous - 09 Jun 2005 16:43 GMT
Thanks

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

Irlan
>> I have an claass that implements another one
>>
[quoted text clipped - 31 lines]
>
> Ray
Raymond DeCampo - 09 Jun 2005 18:16 GMT
Please do not top post after the reply has been bottom posted.

> Thanks
>
> But the PatientInterface is not abstract, and how do i implement a method,

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  UnicastRemoteObject
    implements PatientInterface
{
   private String postCode;

   // What follows is the implementation of the getPostCode()
   // method.
   public String getPostCode()
   {
       return postCode;
   }
}

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

I'm sorry I do not understand this question.

> Irlan
>
[quoted text clipped - 33 lines]
>>
>>Ray

Ray

Signature

XML is the programmer's duct tape.

Irlan agous - 09 Jun 2005 21:08 GMT
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 PatientInterface 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

>> Thanks
>>
[quoted text clipped - 63 lines]
>
> Ray
Raymond DeCampo - 09 Jun 2005 23:35 GMT
> Thanks for the pointers!
> You are right, english is not my native language. its dutch actually, hehe.

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. :-)

> why cant i declate the whole interface if its not abstract?
>
[quoted text clipped - 8 lines]
> 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

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

Signature

XML is the programmer's duct tape.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.