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.

Interface question ??

Thread view: 
Antonio Santiago - 16 Jun 2005 12:23 GMT
Hi group. I think this is an stupid question and it can be resolve with
a couple of lines of code but just now it is impossible to me test it.

The question is: I have a clase A that implements a method "m" of the
interface I. Can I modify attributes of class A into the implementation
of "m" ??

I think yes, but I'm creating a plugins for an existent program
(PoseidonUML) and code into the implementation of an interface method
doesn't modify the class attributes. It is very strage, no?

Thanks in advice,
Antonio.

Signature

-----------------------------------------------------
Antonio Santiago Pérez
( email: santiago<<at>>grahi.upc.edu       )
(   www: http://www.grahi.upc.edu/santiago )
(   www: http://asantiago.blogsite.org     )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Politècnica de Catalunya
-----------------------------------------------------

Remon van Vliet - 16 Jun 2005 13:14 GMT
If i read your explanation correctly (which was a bit of a challenge) then
yes :

interface I {

   public void m();
}

class A implements I {

   public int v;

   public void m() {

       v = 0xff;
   }
}

I dont see how there being an interface is relevant for this example though,
but then it is entirely possible i didnt understand your question properly.

Remon van Vliet

> Hi group. I think this is an stupid question and it can be resolve with
> a couple of lines of code but just now it is impossible to me test it.
[quoted text clipped - 9 lines]
> Thanks in advice,
> Antonio.


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.