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 / November 2005

Tip: Looking for answers? Try searching our database.

abstract class

Thread view: 
marcpirat@yahoo.com - 24 Nov 2005 22:26 GMT
hi

in a abstract class, i created a object.... i ha problem to access
it...

   code:

public class Passerelle{
 static List lstIpServeur;
 static List lstIpClient;
 static List lstPort;
 public static void main(String[] args) throws IOException {
   ServeurPasserelle serveurpasserelle = new ServeurPasserelle();
   serveurpasserelle.start();
 }
}

another class

   code:
abstract public class Protocol {
   public Passerelle passerelle;

   public Protocol(){
     passerelle = new Passerelle();
   }
   abstract public String processInput(String theInput, Socket
socket);
}

in another class (ServeurPasserelleThread )i do

   code:
ProtocolPasserelleServeur protocol = new ProtocolPasserelleServeur();
protocol.processInput("test");

and the last class

   code:
public class ProtocolPasserelleServeur extends  Protocol{
   private  final int WAITING = 0;
   private  final int SENT = 1;
   private int state = WAITING;
   public String processInput(String theInput, Socket socket) {
           lstIpServeur.add(socket.getInetAddress());
       }
       return theOutput;
   }
}

java don't seem to like that

i'm not able to have access to Passerelle list...

any idea
VisionSet - 24 Nov 2005 22:52 GMT
> i'm not able to have access to Passerelle list...

I don't see any class extending Passerelle in order to gain access, since
the lst object I think you refer to is not qualified.

try Passerelle.lstXXX

--
MikeW
marcpirat@yahoo.com - 25 Nov 2005 06:28 GMT
VisionSet a écrit :

> > i'm not able to have access to Passerelle list...
>
[quoted text clipped - 5 lines]
> --
> MikeW

in protocol class, i create a passerelle object
amitkch@gmail.com - 25 Nov 2005 06:48 GMT
A passerelle is a passerelle and a lstIpServeur is a lstIpServeur.
Creating Passerelle instance somwhere does not mean that you can access
its member without qualifiying.

Amit :-)
Roedy Green - 24 Nov 2005 23:47 GMT
On 24 Nov 2005 14:26:50 -0800, "marcpirat@yahoo.com"
<marcpirat@yahoo.com> wrote, quoted or indirectly quoted someone who
said :

>java don't seem to like that

Don't paraphrase.  Always quote the exact error message and show where
it was pointing.  
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Viator - 25 Nov 2005 03:57 GMT
Your lstIpServeur has a package access (by default java gives this
access to instance and class variables) so you can access this in other
classes provided that they are in the same package. However,
lstIpServeur must be qualified.

Amit :-)


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



©2009 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.