From what I understand....
You want getInfo method to return the userName and password.
If your userName and password are object variables(which I assume they must be of type
String...) then remember, in
Java, objects are passed by reference. So whenever you call a method by passsing these objects as parameters, the values assigned to them in the called method, remain till the scope of existence of that object variable(which in your case would be the calling method, if the variables have been instantiated there..).
so even if ure method getInfo returns a void... your userName and password will have the values assigned to them in the getInfo method.