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