Search:

Type: Posts; User: tommyabc

Search: Search took 0.31 seconds.

  1. Thread: i need help

    by tommyabc
    Replies
    7
    Views
    340

    Re: i need help

    class Star {
    public static void main(String[] args){
    for(int i=1; i<=10; i++){
    for(int j=1; j<=i; j++)
    System.out.print('*');
    ...
  2. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    Re: About loop

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

    by tommyabc
    Replies
    14
    Views
    513

    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...
  4. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    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...
  5. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    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,...
  6. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    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...
  7. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    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...
  8. Thread: About loop

    by tommyabc
    Replies
    14
    Views
    513

    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 8 of 8