Results 1 to 4 of 4
  1. #1
    padhu1989 is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Please make me to understand

    Here is the simple program, but I cant understand the execution. Please help me.

    class TwoDArray {
    public static void main(String args[]) {
    int twoD[][]= new int[4][5];
    int i, j, k = 0;
    for(i=0; i<4; i++)
    for(j=0; j<5; j++) {
    twoD[i][j] = k;
    k++;
    }
    for(i=0; i<4; i++) {
    for(j=0; j<5; j++)
    System.out.print(twoD[i][j] + " ");
    System.out.println();
    }
    }
    }

    Please give me the output and explain the steps... Thanks in advance


    (Sorry for my English, English is not my native language)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: Please make me to understand

    Please go through the Forum Rules, particularly tyhe third paragraph. Also go through the Guide For New Members and BB Code List - Java Programming Forum - Learn Java Programming and edit your post accordingly.

    To change the subject line, click 'Edit Post' and then 'Go Advanced'

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: Please make me to understand

    You can learn Java here: The Java™ Tutorials

    Once you've made adequate progress, tell us what you think are the steps of execution. If you have anything wrong, someone will helpfully point that out.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    padhu1989 is offline Member
    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Default Re: Please make me to understand

    Quote Originally Posted by DarrylBurke View Post
    You can learn Java here: The Java™ Tutorials

    Once you've made adequate progress, tell us what you think are the steps of execution. If you have anything wrong, someone will helpfully point that out.

    db

    Thanks brother

Similar Threads

  1. Replies: 4
    Last Post: 07-23-2011, 08:08 PM
  2. Need to Understand code to make window centralized
    By vicky15 in forum New To Java
    Replies: 3
    Last Post: 05-14-2011, 12:49 PM
  3. GUI help. Don t understand
    By s0meb0dy in forum AWT / Swing
    Replies: 2
    Last Post: 10-27-2010, 09:40 PM
  4. Trying to understand
    By ladykrimson in forum New To Java
    Replies: 20
    Last Post: 10-12-2010, 11:10 PM
  5. I don´t understand
    By Manikyr in forum New To Java
    Replies: 6
    Last Post: 02-22-2009, 11:22 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
  •