For 2023 - 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 J703
Variables
Exercises, examples and other material relating to training module J703. This topic is presented on public courses Learning to Program in Java, Java Bootcamp, Java Programming for the Web
Information that's produced by one Java statement and used in later ones is held in variables. In Java, variables must be declared before they are used, and you must specify the type of information they contain. Operations can be performed on variables, and casting can be used to convert information of one type to another.
Articles and tips on this subject | updated | 4345 | Incrementing a variable in Java - Pre and Post Increment Java (and C, Perl and PHP) supports the ++ operator to increment a variable - in other word, do add 1 to the value it holds and save the reult back in the same place.
You can write
counter++;
or
++counter;
and as statemnets on their own, they'll do the same thing.
However, ... | 2014-12-09 | 4324 | Learning to program - variables and constants Further material from our "learning to program in ...." courses ... an introduction to variables and constants
variable basics
Information - data - needs to be stored in a program between statements. Or rather it needs to be stored in the computer's memory. At the lowest of levels, that's a binary ... | 2014-11-22 | 3917 | BODMAS - the order a computer evaluates arithmetic expressions What order does a computer program use to evaluate expressions? If I write
2 + 3 * 4 + 5
does it start off, left to right ...
2 + 3 is 5
5 * 4 is 20
20 + 5 is 25
No! it does not, even though the newcomer might think that was the most natural way for ... | 2012-11-10 | 3365 | Turning bright delegates into bright and knowledgable ones "Bright" does not mean "Knowledgable". Almost without exception, our delegates are bright or very bright. But, by definition, they arrive with us for a training course with a lack of knowlegde. And it's a real joy to be able to pass on that knowledge to them - empowering them so that they leave knowledgable, ... | 2011-07-21 | 3278 | Do I need to initialise variables - programming in C, C++, Perl, PHP, Python, Ruby or Java. Starting with a clean slate. Are variables initisialised, and if so, how? Even with this fundamental question, languages vary considerably.
C and C++
From my (e)mailbag ...
"""In a piece of code we’ve written we declare an array, but we do not fill the elements with values, we assume (dangerous ... | 2011-05-05 | 3041 | Java - basic rules for arithmetic, variables and conversion Declare - Initialise - use - the sequence for Java variables
• All Java variables must be declared before they are initialised
• All Java variables must be initialised to a value before their current value is used
So:
1. Declare (i.e. define the type of variable and the name
2. Set an initial ... | 2010-11-10 | 3038 | Setting up individual variables, and arrays, in Java - some commented examples In Java, variables must be defined before they have an initial value assigned to them, and they must have an initial value assigned to them before the value thay contain is used; there's no automatic assumption that a new name is a variable, nor is there an assumption made of what type of data a variable ... | 2010-11-09 | 2153 | Class Loading and Variable Conversion in Java "Where did you get THAT from?" Ever heard that question? I've asked it of Java sometimes, in wondering where a Java virtual machine has found a class from ... and it's not always obvious.
When loading a class, Java looks at each location given in the CLASSPATH in turn ... and if there are import ... | 2009-05-02 | 1448 | Question on division (Java) - Also Perl, PHP, Python ... Q:
What's the difference between % and /?
A:
/ returns the result of a division
% returns the remainder when you do a division.
Divide 18 by 7 you get 2, with a remainder of 4 (i.e. 4 left over).
so 18/7 give 2, and 18%7 gives 4.
And from Tcl/Tk and Expect... you can see the float v integer considerations ... | 2008-09-15 (short) | 127 | Conversion and coercion in Java The accuracy and conversion of primitive arithmetic variables in Java is something that I'm questioned on regularly.
Ideally in Java, you'll perform arithmetic on two pieces of data of an identical type, and the result returned will be of the same type. However, if you perform a calculation on two different ... | 2006-06-05 |
Examples from our training material
Pictures On site training in Oxford
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
First use of variables in Java. Variable names. Declaring and initialising variables. Primitive types. Type casting and conversion. Reading input from the user.
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.
|
|
|