|
-
String array refuses to accept passed element through a method
i have a method:
public void updateUsers(String[] connectedUsers)
which takes a string array as the parameter. What i'm trying to do is through another class i'm trying to access the method client.updateUsers(client.name); name is a string variable i'm trying to pass that through the updateUsers method so that it updates the list whenever a new client is created with the clients name (string).
I keep getting a compilation error saying that updateUsers(java.lang.String[]) in Client cannot be applied to (java.lang.String).
Here's the exact line i tried:
client.updateUsers(client.name);
Also in the class that i'm trying to access the method (server) which is in client i tried
String[] sa = new String[15];
sa[0] = "test";
and it works?
I don't understand why it's not accepting a string. I tried client.updateUsers() i get a compilation error saying that it can't be applied to ()
Last edited by Emus; 03-26-2005 at 07:34 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks