Java 08: Advanced Arrays

How to unroll and append elements to an array.

Java 1.6
Netbeans 5.5.1 beta

Duration : 0:9:20



11 Responses to “Java 08: Advanced Arrays”

  1. jajaja0 says:

    with that program …
    with that program did you record this with?

  2. jajaja0 says:

    ..and why Netbeans? …
    ..and why Netbeans?

    short before the end I wonderd if you´d really not show ArrayList

  3. gorilla3d says:

    Netbeans is a great …
    Netbeans is a great IDE so is Eclipse just a matter of taste.

  4. ariakokoschka says:

    And what’s so …
    And what’s so advanced about your arrays?

  5. Brian091246 says:

    It would be helpful …
    It would be helpful to see more of the screen

  6. howeworth says:

    Well, not bad, BUT: …
    Well, not bad, BUT:
    First of all, it’s not called the main function but the main method! There are no functions in Java. You could call a method that returns a value a function, but you certainly cannot call a void method like that, which could be called a procedure.
    2nd: There’s no need to use the toString method of the Integer class, you could simply write System.out.println(lightbulbs[0]); the println method is overloaded and it accepts also values of the data type int as arguments.

  7. omnius34 says:

    It is a nice …
    It is a nice example of use of arrays but the application is not practical. For instance if the array gets large in size the amount of overhead will exponentially increase.

    An alternative would be to either allocate the array with ample values or use dynamically allocating pointers. Perhaps a linked list.

    Eclipse is a better IDE. It doesnt bring my cpu utilization to 100% and Eclipse has plugins for almost anything you can think of.

  8. muchomuse says:

    The best …
    The best alternative would be to use the ArrayList class from java.util, IMHO.

    I agree, I love Eclipse!

  9. Yell0wGuy says:

    Methods, functions. …
    Methods, functions… not a big deal. In C you are taught that they’re all called functions, even when the return type is void.
    After all, this isn’t math nor functional programming.

  10. Yell0wGuy says:

    For the array …
    For the array version, there is a handy method Arrays.copyOf() to replace the loop. It even sets the array length of the copy to the one you specify.

  11. romanking123 says:

    Or even better use …
    Or even better use C#.

Leave a Reply

Posted on May 13th, 2007 by admin

Filed under Java Basics | 11 Comments »

|