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 J706
Objects and Classes
Exercises, examples and other material relating to training module J706. This topic is presented on public courses Learning to Program in Java, Java Bootcamp, Java Programming for the Web

In Java, we place all our code in "classes". Each class contains one or more named blocks of code known as methods, and the group of methods provides all the functionality that's required to handle data (or objects) of a particular type.


Articles and tips on this subjectupdated
4422Objects - from physical to virtual or abstract - Java
A train, a person, a dog, a signpost, a meal, a station ... they're all similar objects in programming terms. We can set them up in our program, save and restore attributes - and they make an excellent teaching parallel comparing real life things ("objects") of a certain type ("class").   ...
2015-02-12
 
4413Binomial Coefficient (Pascal Triangle) objects in Java
An exercise on our Java course from which our delegates gain a lot of appreciation is the one in which I ask them to set up an array of arrays containing Pascal's Triangle of Binomial Coefficients. It sounds mighty complex, but I explain it on the board and it comes down to just defining the arrays ...
2015-02-04
 
2169When should I use OO techniques?
We have two friends. They're married. She's a keen advocate of Object Oriented Programming and he can't stand the approach. So take them to the pub, buy them a couple of drinks each, mention OO programming and watch the feathers fly ;-) Seriously, Object Oriented Programming has its place - and there ...
2014-11-05
 
1296An example of Java Inheritance from scratch
One of the most important topics for newcomers to OO (Object oriented) programming to learn is how to design their classes and make best use of inheritance, and I find myself writing new examples from first principles during our courses. That way, the delegates learn how to actually do the job - they're ...
2014-11-05
 
477Class, static and unbound variables
In Object Oriented programming, you'll have certain named blocks of code (usually known as methods) that you can perform on specific objects (type A), and others that you can perform on all the objects of a particular type (type B). Example. If I had a class called sandwich, I might have one method ...
2011-08-18
 
2651Calculation within objects - early, last minute, or cached?
When you create an object with the constructor, you may also set property [attribute] values within it ... or you may follow on with a series of method calls to set the initial values. Then when you pull back values / attributes / properties from your object you return those values, or the results ...
2010-03-03
 
2616Defining a static method - Java, Python and Ruby
Most methods in classes that your write will be run on / applied to individual objects within that class - you'll be asking for the colour of a marker pen, or setting the price of a hotel room. You will NOT - typically - have a model in which all marker pens share the same colour. But - just occasionally ...
2010-02-01
 
2422Looking inside Java classes - javap and javadoc
javap is a program that looks inside a Java class and reports on all the methods and variables that are exposed by that class ... so it's looking at a Java class's object format. javadoc is a program that analyses Java source code and reports on all the methods that are exposed by that class. javap ...
2009-09-25
 
1925Introduction to Object Oriented Programming
"Object Oriented Programming" is a whole new philosophy for programmers who have been writing short scripts for years, and it can be quite frightening to learn with all these new buzzwords like "overriding", "encapsulation" and "polymorphism" creeping in. It's a beautiful concept and a lovely approach, ...
2008-12-10
(longer)
1906Long, Longer, Longest in Java
If you want to find out how long a Film3 is, in the class that I use on our private Java Programming courses, you can call the getminutes method. That's standard OO stuff. But what if you want to find out which is the longer of two Film3s or the longest of a whole array of them? Don't re-write code!!!. ...
2008-11-24
 
96Variable Scope
One of the vital topics on all our programming courses is that of variable scope. Variable Scope may be defined as the area of a program in which a variable is visible, and how long that variable is accessible for. Why do I describe variable scope as a vital subject when you can write simple programs ...
2008-05-11
 
1500First Class Java. First step and moving forward.
Java is an Object Oriented language that's great for medium size through large to huge systems. Which means that it's not usually the best approach for short applications ... of the size that one typically uses as examples on a training course. So examples that I produce show mechanisms and extensibility ...
2008-01-10
(longer)
1163A better alternative to cutting and pasting code
If you're new to coding, you'll be so concerned to be writing code that works that you may not take a look at coding technique. Your nose will be so close to the grindstone as you work that you won't take the time to look and ask "Do I need to keep grinding anyway?" If you find yourself writing a piece ...
2007-04-26
 
Examples from our training material
Animal.java   Sample class for use during practical
Eve.java   Example class that uses the Film class
Eve2.java   Example class that uses the Film2 class
Eve3.java   Static methods and comparing objects - test harness
Film.java   Defining a simple class of objects in Java
Film2.java   A class of objects with static methods, public variables, overloaded constructors and private internal methods
Film3.java   Static methods and comparing objects - class
Ourmenag.java   Sample application for use during practical
Ourpets.java   Our Pets - example application
Ourzoo.java   Ourzoo - sample application
Pictures
Our courses are half practials and half lectures
Background information
You may download this module as a sample of our material
Topics covered in this module
Using an instance of a class.
Some detail of using an object.
Writing your own class.
Enhancements to the basic class structure.
Class or static methods.
Direct variable access.
this.
Overloading.
An example.
Naming conventions.
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/J706.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb