How to display for my code?
<p>My question is how do I display the 2D array which I stored.</p>

<ol>
<li>Specifically, my program needs to display the elements (in somewhat a table) which I stored in them for each month.</li>
<li>Next, it should sum up all the values stored(do I use another array for that?), and display them in a line, e.g. (<code>System.out.println("Total amount spent for the month of January is....."</code>)</li>
</ol>

<p>All help is appreciated!</p>

<pre><code>import java.util.*;
import java.text.*;

public class test {
    static Scanner input = new Scanner(System.in).useDelimiter("\r\n");
    static DecimalFormat fmt = new DecimalFormat("0.00");
    static String months[] = { null, "Jan", "Feb", "Mar", "Apr", "May", "Jun",
            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; // to store month data
    static String monthItems[][] = new String[13][13];
    static double amount[][] = new double[13][13];
    static int m = 1;

    public static void main(String[] args) {
        try {
            System.out.print("Enter month &lt;1 for Jan - 12 for Dec&gt;:  ");
            m = input.nextInt();
            if (m == 0) {
                System.out.println("----------------------------------------");
                System.out.println("Invalid month!");
                System.out.println();
                return;
            } else {
            }
            System.out.println("----------------------------------------");
            System.out.println(months[m] + " Expenditure &lt;max 10 items&gt;");
            // to store data if January is selected
            MonthData();
        } catch (Exception e) {
            // error message to inform user of wrong input
            System.out.println("Invalid month!");
        }

        try {
            System.out.print("Enter month &lt;1 for Jan - 12 for Dec&gt; :  ");
            m = input.nextInt();
            EntryMonth();
            System.out.println("----------------------------------------");
            System.out.println("Expenditure for " + months[m] + ":");
            // to display monthly data
            DisplayMonthData();
        } catch (Exception e) {
            // when user enter's wrong input
            System.out.println("Invalid month!");
        }
    }

    static void EntryMonth()// to allow user to enter month data
    {
        try {
            if (m &lt; 1 || m &gt; 12) {
                return;
            } else {
            }
        } catch (Exception e) {
            System.out.println();
        }
    }

    static void MonthData() {
        try {
            for (int i = 0; i &lt; 10; i++) {
                System.out.print("Enter item " + (i + 1)
                        + " &lt;Press ENTER to exit&gt; : ");
                monthItems[m][i] = input.next();
                if (monthItems[m][i].length() == 0) {
                    return;
                } else {
                    System.out.print("Enter amount : $");
                    amount[m][i] = input.nextDouble();
                    System.out.println("");
                }
            }
        } catch (Exception e) {
            System.out.println("");
        }
    }

    static void DisplayMonthData() {
        for (int row = 0; row &lt; amount.length; row++) {
            for (int column = 0; column &lt; amount[row].length; column++) {
                System.out.println(monthItems[row][column]);
            }
        }
    }
}
</code></pre>
