Results 1 to 13 of 13
  1. #1
    NewToJava1 is offline Member
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default How to put Ints into Arrays..

    hmmm
    Last edited by NewToJava1; 04-22-2012 at 01:56 PM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    How do you want the ints to go into an array?
    Can you explain how you want those 3 (or all 9) variables put into an array?

    Have you read the tutorial on arrays:
    Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    You need to know what goes into the array before you can write the code to assign the values to the array.
    Please explain what you want in an array and where in the array you want it to go.
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    Post the code you have questions about here on the forum.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    NewToJava1 is offline Member
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to put Ints into Arrays..

    question solved
    Last edited by NewToJava1; 04-22-2012 at 01:57 PM. Reason: added code tags

  6. #6
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    You still have not answered my questions!!! See post#2 & #4
    If you don't understand my response, don't ignore it, ask a question.

  7. #7
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    I have no idea what you want to do. You need to say which int values (there are 9) are to go where in what array.

    What does the program print out now?
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    NewToJava1 is offline Member
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to put Ints into Arrays..

    ....
    Last edited by NewToJava1; 04-22-2012 at 01:58 PM.

  9. #9
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default Re: How to put Ints into Arrays..

    Please post what the program prints out now.
    And add comments to show what you want the output to look like.


    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default Re: How to put Ints into Arrays..

    Why don't you just create an array of ints and insert your three variables into it and print them out using a for lop much like you are doing now with your String array. Alternatively increase the size of the String array and convert those three ints to Strings and insert them into your String array

  11. #11
    NewToJava1 is offline Member
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to put Ints into Arrays..

    ....
    Last edited by NewToJava1; 04-22-2012 at 01:57 PM.

  12. #12
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default Re: How to put Ints into Arrays..

    You should research this yourself. Have a look for Integer class API.

    http://docs.oracle.com/javase/tutori...ts/arrays.html
    Last edited by al_Marshy_1981; 04-21-2012 at 06:03 PM.

  13. #13
    ojn
    ojn is offline Senior Member
    Join Date
    Aug 2008
    Location
    Stockholm, Sweden
    Posts
    119
    Rep Power
    0

    Default Re: How to put Ints into Arrays..

    You should have thought of that before. I doubt the moderators will delete a thread that doesn't violate the forum guidelines/rules, just because you got cold feet.

Similar Threads

  1. Comparing in an array with ints
    By queenz68 in forum New To Java
    Replies: 3
    Last Post: 01-02-2012, 06:27 PM
  2. Boolean operators on ints
    By rockgardenlove in forum New To Java
    Replies: 3
    Last Post: 02-10-2011, 04:14 AM
  3. Sum of odd ints 0-n
    By falkon114 in forum New To Java
    Replies: 7
    Last Post: 12-06-2010, 08:36 AM
  4. Help with ints
    By Insomniac Riot in forum New To Java
    Replies: 5
    Last Post: 04-02-2010, 03:53 PM
  5. GUI's and inputting doubles or ints
    By lopder1 in forum New To Java
    Replies: 19
    Last Post: 11-05-2009, 08:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •