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: 2D arrays

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 2D arrays

    Hi
    i'm a total beginner to java, and i've been given an assignment to do but really have no idea on the code to use, i need to link a 2D array up to a 12 x 12 grid and have a player icon be able to move around the grid, and this need to be displayed in the command prompt, so could someone help me just get the grid and 2D array up and compiling and running from there i'm pretty sure i can work out how t proceed, its just getting started is the problem.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: 2D arrays

    Here's how to define a 2D array: int[][] twoD = new int[12][12];
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Arrays ?
    By nhiap6 in forum Java Theory & Questions
    Replies: 3
    Last Post: November 17th, 2012, 12:15 PM
  2. Can Anyone Help With Arrays?
    By metaleddie13 in forum Collections and Generics
    Replies: 9
    Last Post: November 16th, 2011, 12:12 AM
  3. Arrays
    By ruffu054 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: September 7th, 2011, 11:18 PM
  4. Help with arrays
    By mike2452 in forum Collections and Generics
    Replies: 6
    Last Post: August 6th, 2011, 12:15 PM
  5. Arrays
    By mlan in forum Java Theory & Questions
    Replies: 2
    Last Post: February 26th, 2010, 10:23 AM

Tags for this Thread