Search:

Type: Posts; User: tommyabc

Search: Search took 0.36 seconds.

  1. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    Then i will use a method to do it. Thank you.
  2. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    But I need to initiallise matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5 in a class which does not have main class. May i know that if there are any ways i can do it other than using a...
  3. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    Do you mean that I can only set all the matrix[][] locations equal to 5 with a method?
    Because I want to do the following thing but it seems so stupid.


    static int[][] matrix = {{5 /* x200...
  4. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    Sorry, are there any misunderstanding? I mean that loop can only be placed inside a method. Outside a method, there is an error. So what i should do if I want to declare
    matrix[0][0] = 5,...
  5. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    I made a careless mistake here.
    My code is fine now but I want to ask how i can set matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5
    by using loop? A loop can only be performed inside a...
  6. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    Re: About loop

    I want to set matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5
    I want to use for loop to do so but it needs to work in a method.
    Outside a method, I can't use for loop so i need to write a...
  7. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    1,333

    About loop

    Class SetZero{
    int x,y;
    int[][] matrix = new int[200][200];

    void setMartixZero(){
    for(x=1 ; x<=200; x++)
    for(y=1; y<=200; y++)
    matrix[x][y] =...
Results 1 to 7 of 7