1

Hi in this code friend value returning an object.but i want to return to return string array with value. while debugging it giving like this [at.vcity.androidim.types.FriendInfo@b2e758d8, at.vcity.androidim.types.FriendInfo@b2e6d160] java

FriendInfo[] friend=FriendController.getFriendsInfo();

friendinfo.java

public class FriendInfo{




        public static final String FRIEND_LIST = "friendList";
        public static final String USERNAME = "username";
        public static final String IP = "IP";
        public static final String PORT = "port";
        public static final String USER_KEY = "userKey";
        public static final String MESSAGE = "message";  
        public static final String STATUS = "status";
        final boolean[] checked = null;

        public STATUS status;

        public String userName;
        public String ip;
        public String port;
        public String userKey;
        public String expire;


};
1
  • override the toString() function within the object class... Commented Jan 21, 2015 at 13:01

1 Answer 1

1

you have to override toString()

For instance

@Override
public String toString() {
     return userName;
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.