Converting int to String

I'm having trouble converting an integer array to a String.  The current code is something like this:

import java.lang.*;

class Do_Stuff{
private int intPoints[];

public String Convert_To_String
{
  String strOutput;
 
  for (intCount = 0; intCount < 500;intCount++)
{
    strOutput = strOutput + toString(intPoints[intCount]) + " "
}
}
}

When compiled, a warning that the wrong number of arguments are supplied to the toString function.

Any ideas?
butlertg
butlertgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sameerjoshiCommented:
just say



class Do_Stuff{
       private int intPoints[];
       public String Convert_To_String
        {
             String strOutput;
             for (intCount = 0; intCount < 500;intCount++)
             {
                strOutput = strOutput + (new Integer(intCount) ).toString()+ " ";
               }
         }
    }
0
sameerjoshiCommented:

 
0
sameerjoshiCommented:
class Do_Stuff{
   private int intPoints[];
   public String Convert_To_String
   {
   String strOutput;
   for (intCount = 0; intCount < 500;intCount++)
   {
     strOutput = strOutput + (new Integer(intCount[intcount])).toString()+ " ";
   }
   }
   }
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

imladrisCommented:
There is also a static method in Integer you can use:

public static String toString(int i);

so this line:

     strOutput = strOutput + (new Integer(intCount[intcount])).toString()+ " ";


would become:


    strOutput = strOutput + Integer.toString(intCount[intcount])+" ";
0
butlertgAuthor Commented:
Works great, but is a String the right type to use if I were to pass the output to a textbox on a web page?

butlertg
0
sameerjoshiCommented:
Yeah
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.