Introduction
Audience & purpose
This course is intended for the new or inexperienced programmer who wishes to become familiar with the Java programming language, in particular to learn good design and implementation principles. You will be taken step-by-step through the creation and implementation of a desktop application that models a virtual zoo, complete with animals, zookeepers, and visitors. Its user interface will look like this:
Rather than follow any specific development methodology, this course instead uses concepts and techniques which are common to many. In particular, it is iterative; that is, small parts of the application are built and then continually improved upon as the full application is developed, with frequent modifications and enhancements along the way.
Java is a huge language with many facilities, and a course such as this can only provide a subset of such knowledge. It is hoped that you will be able to use the techniques and knowledge gleaned from this course as a solid foundation upon which you can extend your knowledge as you gain experience in developing your own applications.
Prerequisite knowledge
To make best use of this course you should be confident in using a computer, know and understand common computer terminology, and know how to download and install software. If you have prior programming experience, then you are likely to gain additional benefit from this course.
How this course is organised
Because this course develops a complete application from scratch, each section builds on the knowledge of the previous sections and continues the application's development. Therefore, it is recommended that you read the sections in order, especially if you are a complete beginner.
- Sections 1 to 3 introduce Java and basic object-oriented concepts, together with how to create classes, attributes and methods.
- Sections 4 and 5 show how to partition your application and control when things should happen.
- Section 6 demonstrates how to handle groups of items, process them consecutively and arrange them in sequences.
- Sections 7 and 8 how you how to handle unexpected occurrences, how to improve how your code is structured, and how to make parts of your system more reusable.
- Sections 9 and 10 provide additional ways of developing parts of your application, how you can produce documentation for it and test that it works correctly.
- Sections 11 and 12 introduce you to some more sophisticated ways of grouping items and shows how your application can perform more than one process concurrently.
- Sections 13 and 14 introduce the components that make up a graphical user interface.
- Section 15 gives you a means of controlling access between the different parts of your application.
- Sections 16, 17 and 18 develop and complete the graphical user interface that makes up the sample application in this course.
- Section 19 shows you some techniques of saving data to a file on your disk, and how this data can be retrieved later.
- Section 20 rounds off with a brief look at some additional features of Java that have not already been covered in this course.
The software used in this course
This course makes use of the Apache NetBeans development tool. This is a freely available application, download instructions for which are given in the first section. The screenshots are from NetBeans version 7, and it should be straightforward to adapt the instructions when using a more recent version.
Conventions used in this course
New terms are given in bold. Java code that you need to enter, or that is shown as output, is shown in the following style of box:
anObject.doSomething();
Also marked in bold will be directions to use menu bar options, such as File | New Project..., where the vertical bar separates each option.
Names of classes, objects or Java statements will appear in the text using a fixed-width font such as MyClass or someObject, for example.
Where some useful or important additional information about a topic is included, it will be shown in the following format:
Introduction to Java
The Java programming language has become a successful and widely used language suitable for many different types of application, including business applications, games, utilities, networking tools, and many more.
In this section you will learn:
- A brief history of the language
- An overview of object-oriented programming
- How to go about the process of programming
- A simple example program.
Brief history and usages of Java
Java dates back to the early 1990s as a research project undertaken at Sun Microsystems (now part of Oracle) to look at the application of computers to consumer electronic devices. The research team originally considered using C++ but decided the problem was best addressed by creating a new language with the following features:
- Simple & familiar: They wanted the language to be based on C++ so existing programmers would feel at home, but at the same time reduced in complexity
- Object-oriented: They wanted to use the modern approach to software development that more closely models the real-world
- Robust: The language should be strictly checked and omit the error-prone features of C++
- Secure: There should be self-checking to ensure each program's own integrity
- Portable: Programs should be capable of running unchanged "as-is" on a variety platforms & devices
- Sufficient performance: Programs should run fast enough for practical use
- Multi-threaded: Programs should be capable of handling different processes concurrently
Java editions
There are two main editions of Java suitable for different purposes:
- Java SE (Standard Edition): used for general purpose applications including those with a desktop user interface
- Java EE (Enterprise Edition): an extended edition used for large-scale enterprise applications, typically using a browser-based front-end
This course will use Java SE (Standard Edition).
The next lesson looks at the history and usages of Java.
Comments