Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Java module J714
Fundamental classes
Exercises, examples and other material relating to training module J714. This topic is presented on public courses Learning to Program in Java, Java Bootcamp, Java Programming for the Web

The java.util package contains many powerful tools for computer scientists, and is an essential element of most Java applications. You'll learn when and how to use stacks, hash tables and many other utility classes. You'll learn how to sort, how to make system calls (and why you shouldn't!), and how to find out more about your environment.

Related technical and longer articles
Want something more dynamic than an array?
Fundamental classes java.lang, java.util and others

Articles and tips on this subjectupdated
3048String handling - from first steps to practical examples
Initial String handling examples on a training course are sometimes a bit mundane - and that's because we have to cover some of the basics like "what is a string" before we start reading them in useful quantities from files, databases, or web resources. But it's important to get those basics understood ...
2010-11-13
 
2920Sorting - naturally, or into a different order
There's a natural sort order for many things - for numbers, it's ascending, for words it's a dictionary order, for names it's by surname. But sometimes you want to sort a list of things different, or there's no provided way within a programming language to apply the natural sort to your type of thing. In ...
2010-08-20
 
2734for and foreach in Java
Java has had a "traditional" for loop from the beginning:   for (int k=0; k<Allwords.size(); k++) { That's three semicolon separated elements: • initial setting • test to see if loop should continue • action to be taken before each re-test So that when that's used in a loop ...
2010-04-23
 
2649Length, size or capacity in Java?
You get the length of an array, but you ask about the size() of an ArrayList, and you can inquire into the capacity() of a StringBuffer. Aren't they really all the same sort of thing? Which does Java use in which circumstance? Java uses the word length when you're asking about something that can be ...
2010-03-03
 
2323Java Collection Objects in the java.util package
If you want to hold a number of objects in a single composite object, you call it a collection. The Java language itself (without any additional classes) supports arrays, which can hold primitives or objects (example). The java.util package adds a whole further series of classes which can be used to ...
2009-11-02
 
2421Sorting Collections of Objects in Java
The examples that I wrote / finished yesterday ended up with a program called "Zoe" in Java, which read all the records in an access log file, created an object for each of them (which, sensibly would have been called a Hit but we called a "Zoe"), and reported on that object creation. To finish off ...
2009-09-25
 
2418Viv.java uses unchecked or unsafe operations - explanation and cure
Are you getting Java compiler messages like this? Dorothy-2:java grahamellis$ javac Viv.java Note: Viv.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Dorothy-2:java grahamellis$ javac -Xlint Viv.java Which when you expand the warning with -Xlint gives: Dorothy-2:java ...
2009-09-24
 
1910Java - Generics
If you're writing a Java program and you want to hold a whole series of objects of a similar type in a single variable, you can use and array ... except that you need to know HOW MANY of them there will be before you create the array. Using the java.util package, there are numerous more flexible alternatives ...
2008-11-27
 
42Do languages change?
How fast do computer languages change? Not as quickly as you might expect - and yet we're regularly updating our courses. This is because the underlying bedrock (languages) don't change very much, but the functions / libraries / classes / technologies that use them do change, and the applications ...
2008-05-10
 
1502Java, sorting, ArrayList example, generics
A Java ArrayList holds an ordered sequence of items like an array, but there are differences: 1. An ArrayList has no fixed size but can be extended by adding elements later 2. An ArrayList can only hold objects (not primitives) 3. ArrayList elements are addressed by methods and not by square bracket ...
2008-01-12
 
1062Java sorting - comparable v comparator
In Java, you can sort objects that implement the Collection interface, using either the comparable interface or a comparator class. What's the difference? A Comparable interfaced class must contain a method called compareTo to compare two objects (one being the object on which it is called and the ...
2007-02-05
 
Examples from our training material
About.java   System Properties
Access.java   Access Log analysis / String Tokenizer
Acsort.java   Sorting in Java using the comparable interface
Arlist.java   ArrayList in Java
Bus.java   To accompany Trans3 demo
ByValue.java   Comparator for Trans3 demo
Bynum.java   A Comparator class
Discfree.java   Running an operating system command from Java
Handbag.java   A class in which descructor calls are delayed
Hmap.java   Hashmap example
Hmapsort.java   Sorting in Java - using collections
Hset.java   Hashset example
Mathop.java   Maths operations
Mhs2.java   A further example of sorting in Java
Mypocket.java   Forcing a destructor to run
Objvprim.java   Object to primitive comparison
Ptr.java   To accompany Trans3 demo
Strtok.java   StringTokenizer Example
Thing.java   Example of destructor
Train.java   To accompany Trans3 demo
Trans3.java   ArrayList, Hashmap and Collections sorting
Tshirt.java   Utility classes ArrayList and Hashmap set up to help analyse data file
floater   Float object v float primitive
hinton.java   An Example of a Hashtable
holt.java   Using a Vector object
outmarsh.java   Using a stack
stuff   Data for Trans3 demo
Background information
This module is available under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
The fundamental packages.
java.lang.
java.util.
Other fundamental packages.
Data wrappers.
Why use data wrappers?.
Other methods on Float objects.
Other methods on other data wrapper objects.
java.lang.Math.
External low-level calls.
The System class - miscellaneous features.
The System class - garbage collection.
The Runtime and Process classes.
A word of caution on system classes.
Utility objects to hold multiple simple objects.
Vectors.
Stacks.
Hashes.
Enumerations.
The StringTokenizer.
Collections.
ArrayLists.
HashSets.
Iterators and general Collection interfaces.
HashMaps.
Sorting.
Basic sorting in Java.
Comparator classes.
The Comparable interface.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Java,Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/J714.html • PAGE BUILT: Thu Sep 18 11:03:17 2014 • BUILD SYSTEM: WomanWithCat