Difference: JavaNotes (35 vs. 36)

Revision 3609 Mar 2015 - TobyCabot

Line: 1 to 1
 
META TOPICPARENT name="ProgrammingNotes"
(over to JavaProgrammingBookmarks)
Line: 78 to 78
  public class date { public static void main(String[] argv) throws java.io.IOException {System.out.println(new java.util.Date()); }}
Added:
>
>
Make sure that /etc/sysconfig/clock is correct. The ZONE value should point to a valid file in /usr/share/zoneinfo.
 

Arrays vs Collections

Why don't people use arrays in Java? It seems to me that people get so excited about Collection, Set, List etc that they forget about arrays. Arrays have some definite issues, but they also have some advantages. Arrays are fixed-length so they're not good if you're not sure how many things that you're going to put into them in advance. Their big advantage (which limits their use) is that they're strongly typed. This can be an advantage in many cases, i.e. where you've got a bunch of the same thing. In this case an array is nice because it enforces type safety in a way that a Collection doesn't.

View topic | History: r36 < r35 < r34 < r33 | More topic actions...
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback