DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: easy questions

  1. #1
    Join Date
    Oct 2004
    Posts
    18

    easy questions

    Hi there,

    I have 2 easy questions.

    1. how do you add an integer into an array? I know how to add a text to an array (array.add("text")), but I dont know how to add an integer.

    2. How to convert data type integer to datatype text.

    Thanks!!!

  2. #2
    Join Date
    Feb 2004
    Posts
    541
    Arrays don't have methods, so you can't add anything to an array with array.add(). Arraylists on the other hand have methods, and you would add things to them with that method. Are you really using an arraylist instead of an array?

    As for turning integers into strings, you use the Integer.toString(anInt) method.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links