Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: types in a multidimensional array

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default types in a multidimensional array

    Hello,

    I have an assignment for class to create a shopping list that will have an item, its priority, and the price, and those things have to be called by the user later on. I feel like the easiest way to do this should be by creating a multidimensional array, but I'm not sure how to (or if I can) use different types (string, int, double) in an array. Is this possible?

    Thanks.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,067
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: types in a multidimensional array

    use different types (string, int, double) in an array. Is this possible?
    No.
    Look at defining a class to hold all the different data types.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Reading ints into a multidimensional array
    By mju516 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 11th, 2012, 02:45 PM
  2. [SOLVED] adding to a multidimensional array.
    By Scotty in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 27th, 2011, 10:09 AM
  3. multidimensional array 'advancing'?
    By kitube in forum Java Theory & Questions
    Replies: 5
    Last Post: January 25th, 2011, 01:23 PM
  4. Need help in multidimensional array
    By Stefan_Lam in forum Algorithms & Recursion
    Replies: 3
    Last Post: January 14th, 2010, 07:52 PM
  5. Looping through a multidimensional array
    By MysticDeath in forum Loops & Control Statements
    Replies: 2
    Last Post: October 11th, 2009, 05:41 PM