Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Quiz Page java
The java quiz has changed! We have replaced java questions with answers! And from those answers you'll find further links to even more information - forums where you can ask questions, training courses, longer articles, and more. [link to quiz index] ... If you really want the old quiz questions, you can find them here, here, here and here ... and with onward links to the possible answers to each question too.

New in Java 7 - and why we are not running public Java 7 courses
Java 7 (or Java 1.7, if you prefer that name) was launched last summer, with new / improved features including: * switch on a String object * try with resources allowing easier cleanup / reducing ...

Specification, Design, Implementation, Testing and Documentation - stages of a (Java) programming project
There are two key factors in writing even a simple program - working out what you want to do / how you're going to do it, and then actually doing it in the language of your choice. Call the two ...

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 ...

How a for loop works Java, Perl and other languages
Java, Perl, PHP, Ruby, C, C++, Tcl and many other languages support a "for" loop construct. When your program enters the top of the loop, it performs the first statement in the brackets ... in this ...

Disassembling Python and Java - previously compiled code
Most modern languages translate the source code you give into an intermediate byte code prior to it being run, and in can sometimes be useful and instructive to reverse engineer the code to help to ...

Computer Graphics is fun - even if Java Applets are Old Hat
Applets - small applications which include a Graphic User Interface in them - are where Java started ... but they didn't grow as much as other uses of Java and these days they're something of a ...

What is a universal superclass? Java / Perl / Python / Other OO languages
In any object oriented language, all objects will ultimately inherit from a base class supplied with the language, whether it's explicitly stated or not. That's because every class that you write ...

Java Beans, tag libraries and JSPs - what and why.
Java Programming - training course! - just completed. We went a long way from the first steps in Java on Monday through to Servlets and Java Server Pages (JSPs) on Friday - and yet in many ways, our ...

After Course Resources - do we publish sample answers. Example from Java Exceptions module.
At the end of each module on our courses, there's an exercise for the delegates. It lets them make use of many of the elements they've learned about to consolidate their knowledge. And it helps me ...

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 ...

Doing several things at the same time - Java threads
If you have a program that you want to do several tasks at the same time, you can use threads (in Java). You create a runnable object through a constructor, start it when you want it to start and ...

Fresh Paint - Java Arrays
I've just applied a coat of fresh paint to some of our Java examples - Arrays in Java - and added the refurbished examples on the web site. The great news is that the old code just worked (I love ...

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 ...

Why do I need brackets in Ruby ... or Perl, Python, C or Java
In many languages, you're required to put brackets around the boolean condition in your if and while statements, and around parameters you're passing to functions. And it becomes the natural way of ...

Relationships between Java classes - inheritance, packaging and others
When you're designing classes in Java, you need to consider their relationship with one another in various ways. • You need to consider class INHERITANCE - which classes are based on which other ...

Writing a server in Java
My standard recommendation these days is that you don't write your own low level network code - but rather you use standard protocols and classes - i.e. that you use tried and tested ways of ...

Fail Safe Error Handling in Java via Exceptions
"What could possibly go wrong?" ... The usual answer from a cynic is "anything, and usually at the most inconvenient time, and in the most unexpected way!". So checking for routine errors in your ...

MySQL and Java - connectivity past, present, and future thoughts
MySQL has migrated from MySQL AB (1995 to 2008) to Sun (2008 to 2010) to Oracle (from 27 Jan 2010) wizard:java graham$ /usr/local/mysql/bin/mysql -uwellho -p Enter password: Welcome to the MySQL ...

What methods are available on this Java object?
Q: "What can I do with an ArrayIndexOutOfBoundsException?" for example ... A: Use the javap utility to ask what methods are available on the class ... and descent into its base class structure too, ...

Using java, javac, jar, and CLASSPATH - a simple example
What Version of Java am I running? How do I edit, compile and run a Java program? What does this error message mean? How do I puts lots of classes into a single file, then run them from that ...

Type checking, Java arrays and collections
Java's arrays are "typed" - you declare them to contain a particular type of primitive, or a particular type of object (which also enables them to contain any object type which is extended from that ...

for 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 ...

Java - from applets to servlets. JSPs and more
When Java first came out in the mid 1990s, its main focus was on Applets - embedded chunks of applications that ran (and still run!) in a frame within a browser's window in much the same say that an ...

Java Server Pages - putting it all together
I've been teaching Java Server Programming to newcomers this week ... and here are three example that I wrote today, pulling much of the work together. 1. An example of a JSP (Java Server Page) that ...

Reading and writing cookies in Java Servlets and JSPs
Do you want to check (and perhaps set) cookies within a Java Servlet? I was looking around for good, straightforward examples today but found that most of the published code is only snippets rather ...

Length, 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 ...

Java arrays - are they true arrays or not?
Java's arrays are "true" arrays, in that they occupy sequential memory locations in which they are looked up by position number, so that access can be very fast. But that does mean that once an array ...

An example of an injection attack using Javascript
Delegates sometimes ask me what an "injection attack" is, and for examples. I came across a really good example this morning on (oops!) one of our own pages - it's now fixed, but I'm documenting here ...

Defining 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 ...

Tips for writing a test program (Ruby / Python / Java)
Where does my test code go? If you've written a class - a series of methods to be used within another application - how do you test it? How about writing a test program within the same file which ...

All the Cs ... and Java too
Do you get confused between C, C++, C#, Objective C ... and where to Java and J++ fit in? C C is the bedrock of modern computing. It's been around a while (by which I mean for at least 40 years) ...

When should I use Java, Perl, PHP, or Python?
Java is a good language for bigger systems ... teams of programmers writing bits of code that interact with each other. In fact, Java is so well tuned towards the bigger systems that it's not the ...

Using JSPs, Tag Libraries, Java Beans, Tomcat in one short example
I've just completed a Java Bootcamp Course. On Tuesday morning, I had newcomers to Java (but with prior programming experience) and by the end of Friday afternoon, they had written some good ...

Abstract classes, Interfaces, PHP and Java
Abstract classes, Interfaces, PHP and Java Basics. When you design code for a number of different similar type of thing (object types, classes) you don't start from scratch in each case - you ...

What is a JVM, a JRE, a JDK - components of the core Java Environment
Your Java class files run on a JVM - a "Java Virtual Machine" which is a program that reads the instructions in the (binary) class file and performs them. Although the class files are "architecture ...

Looking 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 ...

Sorting 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 ...

Exceptions in Java - why and how
Although it's common practise to include a static main test program in a class, it's something that newcomers can have some difficulty following ... so we don't do it too early on the course - we keep ...

Where is my Java class?
Exception in thread "main" java.lang.NoClassDefFoundError: Gerald OK - so where did Java look, and where should it have looked? Java looks for classes in each of the locations in the CLASSPATH ...

Viv.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. ...


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2012: 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