Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))

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
4431A Java servlet that is also a stand alone program. And a server that is also a web client.
I've been teaching the fundamentals of Java (a private 4 day course) to a number of groups over the past few weeks - each time tailoring the course towards the projects that the delegates (within a large organisation) will be using it for, and also tailoring to suite the background of the delegates. ...
2015-02-19
 
4421How healthy are the stars of stage and screen?
Very few of them, it would seem, are overweight and many are worryingly thin - rather a different situation you'll find in the UK / US population as a whole. Under a body - mass index (BMI) of around 18 to 20, people are considered to be underweight - and taking a data file of online data, I can calculate ...
2015-02-12
 
4396Java Utility class - flexible replacement for array. Also cacheing in objects and multiple catch clauses example.
In Java, utility class objects are used as flexible alternatives to arrays to hold collections of other obejcts. ArrayLists and Vectors hold an ordered (indexed) set of other objects, but due to the structure used in memory, there's no need to know how many items there are going to be in the collection ...
2015-01-17
 
4330Java - factory method, encapsulation, hashmap example
Many of the Java examples on our web site that are used to illustrate the utility classes in Java.util are written using String objects as both key and value - however, on the Java course just completed I wrote a somewhat more complex examples to show the relationship between various aspects of the language. Using ...
2014-11-28
 
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
AUtil.java   Creating a hash of objects
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
Network.java   Vector to replace an array
NetworkStation.java   class uses in AUtil demo
Objvprim.java   Object to primitive comparison
Ptr.java   To accompany Trans3 demo
Station.java   Station class used in Network example
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
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
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,Ruby, Lua, 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.


You can Add a comment or ranking to this page

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

PAGE: http://www.wellho.info/resources/J714.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb