Campbell Ritchie wrote:Did you mean to say not sorted?
Zach Rode wrote:. . . Arrays and Arraylists . . . are not ordered because their positioning is not based on a property of the elements
Alex Niculae wrote:Hello.
I am puzzled by this question, just as the original poster.
The question is:
18. Which of the following are true? (Choose all that apply)
D. An array is ordered.
E. An ArrayList is ordered.
And both D and E are marked correct, with the following explanation:
[...] Both an array and ArrayList are ordered and have indexes. [...]
An ordered collection means that the elements of the collection have a specific order. The order is independent of the value. A List is an example.
A sorted collection means that not only does the collection have order, but the order depends on the value of the element. A SortedSet is an example.
In contrast, a collection without any order can maintain the elements in any order. A Set is an example.
Tim Holloway wrote:Using gc to get a better idea of how much active object memory you are using is a popular thing to do.
In older times, especially in real-time applications, it was sometimes useful to call gc before starting something resource-heavy. Otherwise the user experience could be marred when an automatical gc started in the middle of things and stalled the UI.
A classic example of this was one of the early Amiga Computer demos where it opened 4 windows, each with a moving graphic in them and played music in stereo*. The Amiga was the first home-grade computer with real-time pre-emptive multitasking capabilities straight from the factory. In fact, although Linux has always had pre-emptive multi-tasking, you had to do a custom kernel build if you wanted real-time and that was over a decade later.
But real-time and ore-emptive are no match for a quick-and-dirty port of BASIC that had a blocking garbage collector, so right in the middle of the demo, it would periodically stall - while playing music - to do garbage collection.
This isn't as much of a problem with the smarter and more incremental gc processes in modern Java, but you can see why people got into the habit.
The Amiga was probably the only computer whose on-the-box specifications contained not only RAM and CPU speed, but stereo separation in decibels and Total Harmonic Distortion. Even today, many PCs use a separate sound card. And even when it's on the motherboard, the sound chips used depend on the motherboard manufacturer.
Tim Holloway wrote:I work along the same lines as Joe Ess. Although I also still use Perl if I need something that's heavy on regular expressions.
Python is good for complex quick-and-dirty apps. It's almost exclusively what I use for Raspberry Pi projects, since there's a good fit between the APIs I use and Python. I also use Python BeautifulSoup when I need to mine HTML for data.
Java is what I use when I need industrial strength. That is:
A) I need to handle heavy loads/many concurrent users and I need a robust and complex infrastructure to support me.
B) I need security
C) I need performance
D) I want the flexibility to swap out different service providers at need. For example, Hibernate versus Apache OpenJPA.
Knute Snortum wrote:My experience is that people from the UK can do an American accent better than Americans can do any English or Scottish accents. Take for example Dick van Dyke in Mary Poppins, as they mentioned. On the other hand, take Hugh Laurie on House, MD. I never would have suspected that he wasn't born in America, his accent was so good.