Main Content

Java Programming Fundamentals

Archive - Originally posted on "The Horse's Mouth" - 2009-09-24 06:01:02 - Graham Ellis

Java Programming Fundamentals - sample programs from "hello world" through to objects, inheritance, arrays, packages and utility classes!

This week, I'm running a small Learning to Program in Java course ... and I have taken advantage of the small group size to write a co-herent series of new examples of the basics - showing not only how code works, but also how it is developed. I've uploaded all the examples into a single module, and they're also available through the following links

Adam.java   Hello World, and command line input
Bernie.java   static method (function) calls
Chloe.java   First use of variables and conditionals
Daniel.java   Integer Calculation
Edward.java   Shared code - load and run method from another class
Fred.java   Reading user input from keyboard
Glenda.java   loop, with break and continue
Hilary.java   Passing values in and out of a local method
Irene.java   Arrays - setup, fill, pass, process, length
Julie.java   Array of arrays (i.e. 2 dimensional array)
Keith.java   Using a class
Lenny.java   Static Methods, comparing objects
Margaret.java   String handling example
Niamh.java   loading a method from a class in a package
Orlando.java   Class within a package
Peter.java   underlying (base) class
Quentin.java   Calling in an extended class
Rolf.java   Extended class
Steve.java   A second extended class
Time.java   Base class for examples up to Lenny
Trevor.java   Polymorphism - an array of different objects
Ulrika.java   An array of objects
Viv.java   An ArrayList - an extendable array
WellHouseInput.java  Reading from the keyboard or a file