Java 08: Advanced Arrays
11 Responses to “Java 08: Advanced Arrays”Leave a ReplyPosted on May 13th, 2007 by admin Filed under Java Basics | |
|
Java 08: Advanced Arrays
11 Responses to “Java 08: Advanced Arrays”Leave a ReplyPosted on May 13th, 2007 by admin Filed under Java Basics | |
|
July 23rd, 2007 at 5:50 am
with that program …
with that program did you record this with?
July 23rd, 2007 at 5:59 am
..and why Netbeans? …
..and why Netbeans?
short before the end I wonderd if you´d really not show ArrayList
July 23rd, 2007 at 9:17 am
Netbeans is a great …
Netbeans is a great IDE so is Eclipse just a matter of taste.
September 16th, 2007 at 7:57 pm
And what’s so …
And what’s so advanced about your arrays?
September 28th, 2007 at 7:30 pm
It would be helpful …
It would be helpful to see more of the screen
October 23rd, 2007 at 2:34 pm
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.
November 12th, 2007 at 6:36 pm
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.
November 14th, 2007 at 12:20 am
The best …
The best alternative would be to use the ArrayList class from java.util, IMHO.
I agree, I love Eclipse!
December 22nd, 2007 at 2:41 pm
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.
December 22nd, 2007 at 2:55 pm
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.
February 5th, 2008 at 12:24 pm
Or even better use …
Or even better use C#.