Three Dimensional Array.. help?

Ok so in the program I am writing I need a 3D Array.. Im assuming that it is similar to 2D Arrays.. but my code seems to be doing weird things..
char
char[]
char[][]I know that those work.. but does:
char[][][]because when I compile my files I dont get any errors (JCreator)
JCreator checks the code for errors, but it didnt give me any error messages for using char[][][] and adding stuff to it char[r][c][h] = char; is it possible to use a 3D array like this? I dont want to have 3 regular arrays..

Ok.. So to check if it worked I made a NEW java file and tested out the code..
public class Test
     char[][][] table = char[3][3][3];
     char cLoc = 97;
     public static void main(String[] args)
          for(int r = 0; r < 3; r++)
               for(int c = 0; c < 3; c++)
                    for(int h = 0; h < 3; h++)
                         table[r][c][h] = cLoc;
                         cLoc = 98;
          System.out.println("=====");
          for(int r = 0; r < 3; r++)
               for(int c = 0; c < 3; c++)
                    for(int h = 0; h < 3; h++)
                         System.out.println(table[r][c][h]);
}When I compile with JCreator it says:
' ] ' expected line 3
' .class ' expected line 3
Line three:
     char[][][] table = char[ 3 ][ 3 ][ 3 ];

Similar Messages

  • Creating a colored cube from a three-dimensional array

    Hey guys,
    I'm working on this application which basically displays a 3-dimensional MRI representation of a brain as well as 2-dimensional slices of that representation. As of right now, this MRI data is being stored as gray-scale values in a 3-dimensional array. I've perused the Java3d tutorial and API but I'm not quite sure how I should go about doing this. I am new to using Java3D and so I was wondering if any of you more experienced guys could suggest what you believe is the most sensible as well as efficient method of going about doing this. I was thinking of treating each element in the array as a pixel and representing each pixel as a cube or some other geometric object but this seems highly inefficient and considerably difficult to work with in terms of allowing the user to manipulate (rotate, etc.) the object. I've looked into using geometry arrays but I'm not quite sure they are what I want. Any thoughts, even those such as "this is a stupid post, do more research, the answer is pretty obvious", would be greatly appreciated.

    hi there,
    i'm not sure if this will help.
    I don't know how Java3D does things but anytime i've used or
    seen grey scale(RAW)data being used, the source data
    is copied into an API data container(e.g. Vertex Buffer) and then this data
    is accessed by an index buffer. So, if i were you i would think about
    looking at some Java3D data containers to copy your data into.
    I don't know how you have structured your program but from what i have seen\know
    the gray scale data is used as a height value to the other two
    values(x, z). So for example, you have an image call it a mesh
    this mesh has verticies(x,y,z). These verticies represent your image data.
    The grayscale image data is the height of your y parameter.
    very simplistic but hey this stuff is new to me.

  • Three dimensional array causing repeating pause in movie

    I'm creating what is essentially a 3 dimensional array. It's
    an array of objects, and each of those objects (a map) contains a
    few properties, one of which is a two dimensional array of tile
    objects. The strange thing is that the act of pusing each of these
    map objects on the array causes my movie to run with a periodic
    (about once a second) pause. The more map objects are pushed onto
    the array, the longer the pause. In between the pause, the movie
    runs at what seems like normal speed.
    Does this sound normal? I can see the movie slowing down
    while building the 3 dimensional array, but once the array is built
    (and i've verified that it builds corrently- no endless loops or
    anything), even if I do absolutely NOTHING wtih it I still get the
    pause for as long as my movie runs...
    that's the part that really seems strange to me- the
    repeating pause is directly related to my pushing of the map
    objects onto an array... Even if I build all the map objects and
    don't push them onto an array, the movie plays fine...
    Any ideas or help would be appreciated. For anyone who is
    interested, the associated actionscript is attached. Thanks!

    anyone? I don't need a direct solution... if anything the
    biggest problem I'd like to understand is that if all my objects
    are already created (i.e. already stored in memory), and my array
    is already created- how can simply pushing the objects onto the
    array cause a recurring pause/performance hit- even if I don't use
    the objects (including the array) at all (? All the memory is
    allocated already- all i'm doing is pushing a reference to the
    object onto the array, right? If anything I would think there could
    be a performance hit WHILE pushing objects onto the array, but what
    the heck is creating the pause/performance issue the rest of the
    time?
    I would really appreciate any help, I don't know any flash
    experts in person, and I've been racking my brain on this
    one!

  • Multi-Dimensional Arrays

    Greetings everyone,
    Currently I am working on a project for school, this is my first term in Java and a project we have been assigned to do is pretty much create a application (using the SDK for use on the computer only) and create a application where a new user can modify a new computer from a base system via combo boxes, check boxes, radio buttons and what not. Here is me question. I was going to try and get tricky and create a three dimensional array to link the combo box with a label so the end user could choose an up grade, see what the upgrade did and see what the cost was say for instance:
    Athlon 64X2 4200+(combo) amd athlon 64 X2 4200+ 2.2GHz 1MB Cache Add $300.00
    Each one of those i was thinking i could place in a seperate column and each have a variable already assigned such as array[0][0] = Athlon64X2 4200+ array[0][1]="AMD Athalon 64.." array[0][2]="Add $300.00". I thought that, maybe it is, and i did something wrong and missed something. Anyhow, now i have broke it down to trying to do it with a reg array feeding the combo and the two dimensional array doing teh cost upgrade and the description, i guess my question is, why is it when i seem to try everything to grab the information i set in the array it does not seem to want to pull it. And if and when i do get it to work, how can i link the two dim with the combo. I am rather confused, maybe i am looking more into it then there really is, which i have done in other languages.
    If someone could give me a moch code using what i had there so i might clear the fog in me head, it would be greatly appreciated. If i have confused others with my confusion, just ask and i will try to clear it up. Thanks for all and any help.
    Whitz3nd

    The course i am taking is a rather basic Java programming class. We are using arrays instead of databases to get use to working with handling data. That is why the arrays. If that clears anything up. I know it seems kind of crude, like i said it is a basic Java class.
    Here is an easier question, that i would like to know:
    in a two dimensional array,
    if i had this info:
    AMD Athlon64 3100+
    AMD Athlon64 3300+
    AMD Athlon64 3800+
    and
    Add $100.00
    Add $200.00
    Add $200.00
    How would i place this data into an array. Would it be this way:
    String [][] test = { {"AMD Athlon64 3100+,Add $100.00"}, {"AMD Athlon64 3300+,Add $200.00"},{"AMD Athlon64 3800+,Add $200.00"} };
    As i said, i am a new person to the programmaing world, so please excuse my shortcomings!

  • Need some help with multi dimensional arrays plz

    Hello,
    Lets say I have a three-dim array, call it pyList. This array goes from pyList[0][0][0] to pyList[5][5][5] (216 values). Now, I also have a two-dim array, call it V, which goes from V[0][0] to V[35][5]. What I would like to do is assign V[0][0] the value in pyList[0][0][0], V[0][1] to pyList[0][0][1], and so on up to V[0][5] = pyList[0][0][5]. Then I want V[1][0] = pyList[0][1][0]...
    I want this to go on until V[35][5] = pyList[5][5][5]. Basically Im splitting up pyList into chunks of 6 consecutive values and making each row in V equal to those 6 values.
    Is this possible to do? I cant seem to figure out the proper way to set up the for loops so that my indices are correct.
    If anything is unclear please let me know.
    Any help is greatly appreciated.
    Thank you
    -Big_Goon

    Do you need to create new arrays? That is, should the array V[0] be a different object than pyList[0][0]?
    Since "multidimensional arrays" are simply arrays of arrays it is possible to write V[0] = pyList[0][0] and then every V[0][x] is the same as pyList[0][0][x]. But if you change either of them the change will show in both arrays.
    Otherwise, you will need a loop:for (int y = 0; y < 36; y++)
        System.arraycopy(pyList[y / 6][y % 6], 0, V[y], 0, 6);Or maybe it's more maintanable with two:for (int y = 0; y < 6; y++)
    for (int x = 0; x < 6; x++)
        System.arraycopy(pyList[y][x], 0, V[6*y + x], 0, 6);

  • Set number of elements in a two dimensional array

    Hi,
    Does anyone know how to set the number of elements in a two dimensional array directly in teststand.
    To set a one dimsional array is simple:
    SetNumElements( locals.somearray,4)
    Is there a method to do this for a two dimensional array?
    Sean

    From the help file (TestStand 4.2.0):
    PropertyObject.SetNumElements
    SetNumElements Method
    Syntax
    PropertyObject.SetNumElements ( numElements, options = 0)
    Purpose
    Sets the number of elements of a single dimensional array.
    Remarks
    This method is only valid for single dimensional arrays. The elements in the array retain their values. Use the PropertyObjectType.ArrayDimensions property to set the number of elements in each dimension of a multi-dimensional array.
    Parameters
    numElements As Long
    [In] New number of elements for the array.
    options As Long
    [In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.
    This parameter has a default value of 0.
    So you could use, for example: Locals.MultidimensionalArray.Type.ArrayDimensions.SetBounds({1,0},{3,4}) to set an array to have three dimensions (1,2,3), each with five elements (0,1,2,3,4).

  • How can I use two single-dimensional arrays-one for the titles and array

    I want to Use two single-dimensional arrays-one for the titles and one for the ID
    Could everyone help me how can i write the code for it?
    Flower
    public class Video
    public static void main(String[] args) throws Exception
    int[][] ID =
    { {145,147,148},
    {146,149, 150} };
    String[][] Titles=
    { {"Barney","True Grit","The night before Christmas"},
    {"Lalla", "Jacke Chan", "Metal"} };
    int x, y;
    int r, c;
    System.out.println("List before Sort");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);
    System.out.println("\nAfter Sort:");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);

    This is one of the most bizarre questions I have seen here:
    public class Video
    public static void main(String[] args) throws Exception
    int[] ID = {145,147,148, 146,149, 150};
    String[] Titles= {"Barney","True Grit","The night before Christmas", "Lalla", "Jacke Chan", "Metal"};
    System.out.println("List before Sort");
    for(int i = 0; i < Titles.length; i++)
       System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles);
    System.out.println("\nAfter Sort:");
    for(int i = 0; c < Titles.length; i++)
    System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles[i]);
    Generally you don't use prefix (++c) operators in you for loop. Use postfix (c++).
    Prefix means that it will increment the variable before the loop body is executed. Postfix will cause it to increment after.

  • Best practice in JSTL with multi-dimensional arrays

    Hi,
    I'm working in a project and I'm trying to convert some code into JSTL way, I have a first.jsp that calls addField(String, String) from fieldControl.jsp:
    (first.jsp)
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ include file="fieldControl.jsp" %>
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <%! String[][] list1;
    %>
    <%
    list1 = new String[2][2];
    list1[0][0]="first_1";
    list1[0][1]="first_2";
    list1[1][0]="second_1";
    list1[1][1]="second_2";
    for (int i=0;i<list1.length;i++){
    String html;
    html = addField (list1[0], list1[i][1]);
    out.println(html);
    %>
    </body>
    </html>
    (fieldControl.jsp)
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page language="java" %>
    <%! public void addField(String name,String label)
    return ...
    Now for JSTL I've this example from "JSTL pratical guide for JSP programmers" Sue Spielman:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <html>
    <head>
    <title>
    Display Results
    </title>
    </head>
    <body>
    <%-- Create a HashMap so we can add some values to it --%>
    <jsp:useBean id="hash" class="java.util.HashMap" />
    <%-- Add some values, so that we can loop over them --%>
    <%
         hash.put("apples","pie");
         hash.put("oranges","juice");
         hash.put("plums","pudding");
         hash.put("peaches","jam");
    %>
    <br>
    <c:forEach var="item" items="${hash}">
    I like to use <c:out value="${item.key}" /> to make <c:out value="${hash[item.key]}" />
    <br>
    <br>
    </c:forEach>
    </body>
    </html>
    and my problem is :
    1st - how to use the multi-dimensional array in this way (<jsp:useBean id="hash" class="java.util.HashMap" />) ? because if I use it like this
    <% String[][] list1;
    list1 = new String[2][2];
    list1[0][0]="first_1";
    list1[0][1]="first_1";
    list1[1][0]="second_1";
    list1[1][1]="second_2";%>
    <c:out value="${list1}" />
    <c:out value="${list1.lenght}" />
    I get nothing,
    also tryed <c:set var="test" value="<%=list1.length%>" /> and got "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"
    2nd hot to make the call to the method addField?
    Thanks for any help, I really want to make this project using JSTL, PV

    When you are using JSTL, it is best to not put data inside the JSP. Put it inside JavaBeans. Then make calles to the methods in those JavaBeans.
    So you should get used to JavaBeans and their requirenments.
    Access JavaBeans only through 2 types of methods: getters and setters.
    Getters are used to "get" values (properties) from the bean, and always have the form
    public Type getPropertyName(void)
    That is, they are public, return some value, start with the exact string "get" end with the name of the property (first letter of the property name capitalized) and have a void (empty) argument list.
    For example, this is a good signature to get HTML from a bean:
    public String getHtml()
    Setters are used to assign values to a bean. They always have the form
    public void setPropertyName(Type value)
    That is, they are public, do not return anything, start with the string "set", end with the name of the property (first letter capitalized), and take a SINGLE parameter.
    public void setHtml(String value)
    Also, JavaBeans must have a no argument constructor and need to be Serializable.
    The way I would approach this would be to create a JavaBean that holds the two dim array for you, and has a getter that returns a list of all the formatted html.
    package mypack;
    import java.util.List;
    import java.util.ArrayList;
    public class DataFormatterBean implement java.io.Serializable {
      private String[][] list;
      public DataFormatterBean() {
        list = new String[2][2];
        list[0][0]="first_1";
        list[0][1]="first_2";
        list[1][0]="second_1";
        list[1][1]="second_2";
      public List getHtml() {
        List outputHtml = new ArrayList(list.length);
        for (int i = 0; i < list.length; i++) {
          String html = addField(list[0], list[i][1]);
    outputHtml.add(html);
    return outputHtml;
    private addField(String a, String b) { .. do work .. }
    Then, the JSP would look like this:
    <jsp:useBean id="dataFormatter" class="mypack.DataFormatterBean"/>
    <c:forEach var="htmlString" items="${dataFormatter.html}">
      <c:out value="${htmlString}"/>
    </c:forEach>Once you start thinking in terms of having JavaBeans do your work for you JSTL is so much easier... and it gets even easier when you start to delve into custom tags.

  • How do we save three 1D arrays in while loop as an excel file? I used build array, waveform. I could not make it work.

    I have three separate 1 dimensional arrays in a while loop. I need to combine these arrays and save as a excel file outside the loop.
    My second question is that is there any emergency STOP button in Labview so that when I press that button, it cuts all the power going to the system. Thanks...

    Just a comment on the Stop button.
    It's not really a good idea to rely solely on a software emergency shutdown. Especially if the shutdown is to prevent some type of hazardous condition to the people running the test. The problem is that if your application or PC in general is having some type of problem, it may not be able to shut everything down as needed.
    You should always have a mechanical �Big Red Stop Button� that you can hit to cut power to everything. In addition to the button, I usually do have LabVIEW monitor things and if conditions are not looking good, have it automatically shut things down. This has always worked good, and I can�t remember any time I�ve actually had to use the big button, but it�s nice to know it�s there.
    VERY IMPORT
    ANT:
    Using the �Abort� button on the LabVIEW toolbar is NOT the thing to do. This stops your application where ever it is in its execution and does not allow it to finish or execute any shutdown code you might have put in. A �Kill� button on the front panel works well. I�ve put a single Boolean terminal in its own little While loop to monitor it. It usually writes to a digital line that�s holding a relay on that will cut the power.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Variable number of two dimensional arrays into one big array

    I have a variable number of two dimensional arrays.
    The first dimension is variable, the second dimension is always 7.
    i.e.:
    Object[][] array0 = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    Object[][] array1 = {
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Object[][] arrayi = ...I'm generating these arrays with a for-loop:
         for (int i = 0; i < filter.length; i++) {
              MyClass c = new MyClass(filter);
              //data = c.getData();
    Where "filter" is another array which is filled with information that tells "MyClass" how to fill the arrays.
    "getData()" gives back one of the i number of arrays.
    Now I just need to have everything in one big two dimensional array.
    i.e.:Object[][] arrayComplete = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Any idea on how to accomplish this? It's blowing my mind right now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Just brainstorming here:
    Why not put your actual data in a class and store that in a LinkedList (so you know the total number of elements for your multi-dimensional array). Then initalize your multi-dimensional array and populate it? Haven't tested the following, but thinking something along the lines of
    public class MyData {
         //data here
         public Object[] toArray() {
              //something similar to this
              return new Object[] = {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"};
    LinkedList<MyData> data = new LinkedList<MyData>();
    data.add(mydata1);
    //however many times you need
    Object[][] arrayComplete = new Object[data.size()][7];
    for(int i = 0; i < data.size(); i++) {
         arrayComplete[i] = data.removeFirst().toArray();
    }Another option for knowing how many rows you would need might be using something like:
    int rows = 0;
    rows += array1.length;
    rows += array2.length;
    //etc...But is not entirely useful if you don't know how many variable arrays you have (although reflections might help if the name of the array variable is incremented systematically, someone told me earlier to avoid reflections since it could make debugging a LOT more difficult).
    Edited by: bogdana on Apr 1, 2010 10:38 AM

  • Setting up a multi dimensional array of objects

    Hey ya'll. How would i setup a multi dimensional array with this structure?
    TypeSave(Title, material(name, quantity))
    TypeSave[1](Lego Shop, material[1](Lego Blocks, 100))
                   material[2](Roof, 1))
    TypeSave[2](Lego Car, material[1](Door, 2))
              material[2](Gravy, 3, ounces))
    TypeSave will be saved as a serialised object to a file so i can load everything within it and keep the structures integrity.
    I'll have an add button that will add the name and quantity to the next empty position of "material" array. This will then be listed in a list box and allow me to save all the materials with a title to the TypeSave list in the next empty position.
    I'm getting mightily confused how to set up the classes and the array structure :(
    Any help would be greatly appreciated!

    private TypeSave t = new TypeSave();
    private void btnSaveItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
            t.addItem(txtItemTitle.getText(), new Material(txtMaterialName.getText(),txtQuantity.getText()));
            t.saveToFile();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MainForm().setVisible(true);
        class Material implements Serializable {
         String name = null;
         String quantity = null;
         //To restrict default constructor
         private Material() {
         public Material(String name, String quantity) {
              this.name = name;
              this.quantity = quantity;
         public String getName() {
              return this.name;
         public String getQuantity() {
              return this.quantity;
         public String toString() {
              return "Name : " + this.name + "Quantity : " + this.quantity;
    class TypeSave implements Serializable {
         private Hashtable items = null;
         public TypeSave() {
              items = new Hashtable();
         public void addItem(String title,Material material) {
              ArrayList materials = (ArrayList) items.get(title);
              if(materials == null) {
                   materials = new ArrayList();
                   items.put(title,materials);
              materials.add(material);
         public Hashtable getItems() {
              return this.items;
         public ArrayList getItem(String title) {
              return (ArrayList)this.items.get(title);
            void saveToFile() {
        ObjectOutputStream oos = null;
            try
            oos = new ObjectOutputStream(new FileOutputStream("item.ser"));
            catch (IOException i)
              System.out.println( "Error opening file");
          try
            oos.writeObject(items);
            catch (IOException o)
                System.out.println("Error writing file");
          try
              if(oos != null)
              oos.close();
            catch (IOException x)
                System.out.println("Error closing file");
    }My save class was working, but i tried to merge it to test this code structure and now it's failing with excepion:
    "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"
    any ideas?

  • Binding arraylist, list, or multi-dimensional array to table in web dynpro

    Greetings,
    I like to ask if anyone knows how to bind data from an arraylist, list, or multi-dimensional array list to a table in web dynpro, your help is much appreciated.
    Thanks in advance.
    Cory

    Is there a way to create or cast a multi-dimensional
    array from a Collection or Vector ?
    ArrayList list = new ArrayList();
    list.add( new Object[4] );
    Object[] array2 = list.toArray(); // is only
    single dimension !
    Of course it is a single dimension array.
    Check the definition of the toArray() function, and the specification of arrays in general.
    toArray() returns a one dimensional array.
    In your case it will return an array of arrays. So array2[0] will be an array of 4 objects.
    That just happens to be a 2 dimensional array though you may (I haven't checked it) need some parentheses to call the elements.
    Try Object o = array2[0][1]; and if that doesn't work Object o = (array2[0])[1];

  • Two dimensional array in JSP with struts

    Is it possible to use two dimensional array in an web application
    based on struts. I am using JSP and to get data from two dimensional
    array im using
    property = "array[0][0]";I read on the internet that bean utils does not support two dimensional array?
    I have a table like spreadsheet with 30 rows and 20 columns and i was
    planning to use two dimensional array? is there any other way to get
    this stuff done easily?
    any ideas welcome.

    HI ,
    i have the same problem you had
    did you get any solution for this?
    if so you can help me out

  • Creating a Two Dimensional Array in Xcode and populating it with a values f

    Whats the easiest way to declare a two dimensional array in Xcode. I am reading an matrix of numbers from a text file from a website and want to take the data and place it into a 3x3 matrix.
    Once I read the URL into a string, I create an NSArray and use the componentsSeparatedByString method to strip of the carriage return line feed and create each individual row. I then get the count of the number of lines in the new array to get the individual values at each row. This will give mw an array with a string of characters, not a row of three individual values. I just need to be able to take these values and create a two dimensional array.

    I'm afraid you are in the wrong place. Look here for the last two forums on programming. However, XCode support is mostly found at developer.apple.com. You can access their forums by registering. Registration is free.

  • How can I use two dimensional array ?

    Could some one show me how to use two dimentional array ?
    I am know how to right a single ...but not two dimentional....please help,
    Thanks,
    Flower
    public class Exam5
    public static void main(String[] args)
    int[][] numbers =
         {     {1,2,3,4,5,6,7,8,9,10},
    {1,2,3,4,5,6,7,8,9,10} };
    for(int i = 1; i < 11; ++i)
    System.out.println(i + "\t" + i * 2 + "\t" + i * 3 + "\t" + i * 4 + "\t" + i * 5 +
    "\t" + i * 6 + "\t" + i * 7 + "\t" + i * 8 + "\t" + i * 9 + "\t" + i * 10);
    Display #
    1     2     3     4     5     6     7     8     9     10
    2     4     6     8     10     12     14     16     18     20
    3     6     9     12     15     18     21     24     27     30
    4     8     12     16     20     24     28     32     36     40
    5     10     15     20     25     30     35     40     45     50
    6     12     18     24     30     36     42     48     54     60
    7     14     21     28     35     42     49     56     63     70
    8     16     24     32     40     48     56     64     72     80
    9     18     27     36     45     54     63     72     81     90
    10     20     30     40     50     60     70     80     90     100

    First, try not to ask someone to do your homework for you and then tell them they are wrong. The code posted may not have been exactly what you were looking for, but it was not wrong because it did exactly what the poster said it would do - print out the multiplication table.
    Second, in the future if you ask specific questions rather than posting code and hoping someone will fix it for you, you may one day be able to complete the assignments on your own.
    Here is code that prints what you want and uses a two dimensional array. Please ask questions if you do not understand the code. You will never learn if you just use someone else's code without taking the time to examine or understand it.
    public class MultiTable{  
        public static void main(String[] args)   { 
            int rows = 10;
            int columns = 10;
            int [][] numbers = new int [rows] [columns];
            for(int j = 0; j < rows; j++)   // for each of 10 rows
                for(int k = 0; k < columns; k++)    // for each of 10 columns
                    numbers[j][k] = (j+1) * (k+1);  // calculate row+1 * col+1
            for (int j = 0; j < rows; j++)  // for each of 10 rows
                for (int k = 0; k < columns; k++)   // for each of 10 columns
                    System.out.print(numbers[j][k]+" ");    // print out result
                    if (numbers[j][k] < 10)     // for single digit numbers
                        System.out.print(" ");  // print extra space for better formatting
                System.out.println();       // skip to next line
    }

Maybe you are looking for

  • Error Message: Sorry, a serious error has occurred that...

    This seems to be a common problem, however, I have not found a fix. I am somewhat technologically savvy, but limited! Listed below are my specs and details to the problem. Software- Premiere Pro (Version 5.03) Recently updated OS- WIN7 Core 2 Duo CPU

  • Random Lock ups

    I'm using K9N2-SLI plat with Bios 3.5, AMD64 X2 6400+ Black Ed., 4GB ram (2x2GB Cas 4-4-4-12 T2 matched set), XFX 8800GTS(92) 512, Corsair TX650, Artic Cooler Freezer64 CPU H/S running Vista64 Home Premium Sp2. I'm having random lock-ups during 3D ga

  • Can't Install iTunes on my laptop with Windows Vista...PLEASE HELP

    I've received error messages every time I try to download iTunes. I've tried the troubleshooting steps on Apple's website but no luck.

  • Selection screen in abap report

    Hi, I am using 2 selection options in my report. But the list of values for second selection options is depends on the selected value in the first selection option. how to do this. because i cant use selected value of first option in AT-SELECTION poi

  • ITunes and Windows Vista 32 bit version install issues...need help

    Trying to install iTunes version 7.6 and it is not working all my research keeps mentioning 7.2. Is there any reason why 7.6 won't work?