Learn Programming in Java


I started to write this tutorial when I thought somebody would use it. That didn't seem to happen, so I stopped working on it. If you really want to use this, convince me, and I'll try to bring it up to date. Or maybe I'll just point you at my earlier effort to Teach Yourself JavaScript. (TP 18June26)

This is the on-line mirror of a one-week course designed to get eager, self-motivated people started in the skill of programming. Nobody learns programming in one week, it takes time and practice -- "motivation and miles" -- but we can give you a roadmap. Once you more or less understand the basic structure of things, you can look at existing programs and figure out how they work -- and by extension and a lot of copying, you can write your own code to do similar things.

We do it here in Java, which is similar in appearance to both C/C++ and JavaScript, so that switching to one of those languages, while not trivial, at least you understand the basic principles. Programming is a lot of work, and even more attention to detail, but you can do it if you want to. If you want life to be easy, find a different profession, but there's a lot of satisfaction in telling a computer what to do and seeing it do it.

Before you can program a computer, you need to be able to use it, that is, you need to be reasonably skillful at clicking and dragging and double-clicking and drag-selecting and copying and pasting and (of course) typing into fields in windows. You need recent a Windows (Win7 or later) or OSX (again, x.7 or later) computer to do this on. You could do it on Linux or an earlier computer, but it's harder; save that for after you get good at it (if you still want to). It also helps if you understand mathematical formulas and maybe a little algebra, but not much.

The most important requirement to be good at this is attention to detail. I call it "Observant, Careful, and Determined."

I had a lot more introductory remarks, but they filled up my page with this massive gray sea of text, so I cut them out. I still rather like what I said, and I expect my remarks might be useful to you too, if you care to read them here.


OK, let's get started. Here are the topics we cover, in subsequent pages:

Introduction & Language
Lesson #0: Programming Environment
Lesson #1: Sequence & Output
Lesson #2: Variables & Expressions
Lesson #3: Conditionals & Input
Lesson #4: Iteration & Termination
Lesson #5: Subroutines & Recursion
Lesson #6: Classes & Objects
Lesson #7: Extras


Next: Programming Environment

Revised: 2016 October 20