Java Reference
In-Depth Information
Learning Java
Java is not difficult, but there is a great deal to it. The language itself is fairly compact, but very
powerful. To be able to program effectively in Java, however, you also need to understand the libraries
that go with the language, and these are very extensive. In this topic, the sequence in which you learn
how the language works, and how you apply it, has been carefully structured so that you can gain
expertise and confidence with programming in Java through a relatively easy and painless process. As
far as possible, each chapter avoids the use of things you haven't learned about already. A consequence,
though, is that you won't be writing Java applications with a graphical user interface right away. While it
may be an appealing idea, this would be a bit like learning to swim by jumping in the pool at the deep
end. Generally speaking, there is good evidence that by starting in the shallow end of the pool and
learning how to float before you try to swim, the chance of drowning is minimized, and there is a high
expectation that you will end up a competent swimmer.
Java Programs
As we have already noted, there are two kinds of programs you can write in Java. Programs that are to be
embedded in a web page are called Java applets , and normal standalone programs are called Java
applications . You can further subdivide Java applications into console applications, which only support
character output to your computer screen (to the command line on a PC under Windows, for example), and
windowed Java applications that can create and manage multiple windows. The latter use the typical
graphical user interface (GUI) mechanisms of window-based programs - menus, toolbars, dialogs and so on.
While we are learning the Java language basics, we will be using console applications as examples to illustrate
how things work. These are application that use simple command line input and output. With this approach
we can concentrate on understanding the specifics of the language, without worrying about any of the
complexity involved in creating and managing windows. Once we are comfortable with using all the features
of the Java language, we'll move on to windowed applications and applet examples.
Learning Java - the Road Ahead
Before starting out, it is always helpful to have an idea of where you are heading and what route you
should take, so let's take a look at a brief road map of where you will be going with Java. There are five
broad stages you will progress through in learning Java using this topic:
1.
The first stage is this chapter. It sets out some fundamental ideas about the structure of Java
programs and how they work. This includes such things as what object-oriented programming is all
about, and how an executable program is created from a Java source file. Getting these concepts
straight at the outset will make learning to write Java programs that much easier for you.
2.
Next you will learn how statements are put together, what facilities you have for storing basic
data in a program, how you perform calculations and how you make decisions based on the
results of them. These are the nuts and bolts you need for the next stages.
3.
In the third stage you will learn about classes - how you define them and how you can use
them. This is where you learn the object-oriented characteristics of the language. By the time
you are through this stage you will have learned all the basics of how the Java language works
so you will be ready to progress further into how you can use it.
Search WWH ::




Custom Search