Helo, there are 3 files, CustomerClient.java, CustomerServer.java and Customer.java
views:
53answers:
2
+2
A:
On
The issue with main
method not being a proper application entry point aside, this code should compile and run just fine. The problem seems to lie elsewhere, and there's not enough information at the moment to identify the source.
Related questions
- Java Beginner question about String[] args in the main method
- Exception in thread “main” java.lang.NoSuchMethodError: main
On toString()
The reason why printing s[0]
"prints junk as usual" is because you didn't @Override
the toString()
method inherited from Object
.
If you had just added this method:
@Override public String toString() {
return "Student : " + name;
}
then printing s[0]
wouldn't print "junk"; it would print whatever the above toString()
returns (which in this case, is something reasonably "not junk").
Related questions
polygenelubricants
2010-05-28 18:29:12