Possible Duplicate:
java : non-static variable cannot be referenced from a static context Error
My aim is to create a program for client server chat.I wrote the following code https://github.com/jinujd/Java-networking/blob/master/Server.java for the server.. After compilation I got the following error.
non-static variable this cannot be referenced from a static context. What is the problem there? My another doubt is that
/*A.java*/
class A {
String a;
class B {
}
public static void main() {
}
}
Is the variable a accessible to B and main() ?