Learn Programming in Java

This is a self-paced short course designed to get eager, self-motivated people started in the skill of programming. Nobody learns programming in one or two weeks or even a whole semester, 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.

tl;dr = Stop Here

Programming a computer to do what you want it to do -- rather than one of a small number of things somebody else decided to let you tell it to do -- is a text-based activity. You write programs using a keyboard, and you will spend a lot of time reading -- mostly your own code, but while you are learning, you also read other people's code and the detailed instructions for how this programming language works, or how to make that library method do what you want it to do -- and if you get really good at it, you will also spend a lot of time reading about (learning) the problem domain you are writing programs for.

If you don't like reading and writing, if "tl;dr" (= "too long, didn't read") is a phrase you use often, then you might consider a different profession, perhaps ballet or baseball or carpentry, where watching videos (plus a lot of practice) can get you all you need to know.

But computers run the world. If you want to take control of your life, you need to know how computers work, in particular how they are programmed. We can get you that far, if you are willing to -- just for this course -- spend the time reading. You can do it, if you want to. We are here to help you do what you want to do (with computers), but you must do the work yourself. It's hard work, but that's why the pay is good. As sci-fi novelist Heinlein told us, "There Ain't No Such Thing As A Free Lunch." If you believe there is (or should be) easy money, you need to find it some other place. Churchill offered his people "Blood, sweat, toil and tears." Programming isn't quite that bad, but expect to earn your keep. It's actually fun after you've done it a while, you get a feeling of accomplishment, of creativity: you did something new! Other kinds of creativity like writing novels or songs and painting also give some of that satisfaction if you work at doing it well, but only computer programming can actually change the world.

The most important requirement to be good at this is attention to detail. I call it "Observant, Careful, and Determined"  It helps a lot if you enjoy knowing how things work, because programming is first of all knowing in great detail how your program should work, and then writing it down, first in English (or whatever language you prefer to think in), then in Java (or whatever language the computer thinks in).

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 you can read them here ("tl;dr" is OK, it won't cost you much, but it does help you know if this is what you want to do for the rest of your life).

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

You Already Know How (programming in "English")
Preface 0.1 (Steve's PBJ)
Preface 0.3 (If it's Saturday then choose Strawberry)
Preface 0.5 (Steve's Breakfast)
Preface 0.7 (Steve's Stoplight)
Preface 0.8 (Steve's Rock-Paper-Scissors)
Preface 0.9 (Tom's Subroutines)
Running Your English Program in Tom's Kitchen computer

Programming in Java
Introduction & ToC (you are here)
Lesson #0: Programming Environment
Lesson #1: Sequence & Output
Lesson #2: Variables & Expressions (Strings)
Variables & Expressions (Numbers)
Bitwise Operators
Lesson #3: Conditionals & Input (Guessing Game)
Using the BlueJ Debugger
Lesson #4: Iteration
Rock-Paper-Scissors Game
Lesson #5: Arrays & Hangman
ASCII Graphics & Subroutine(s)
Lesson #6: Simple Calculator
Lesson #7: Exceptions
Lesson #8: Native Java Input
Classes & Objects
Lesson #9: Event-Driven Software (Convert Game)
Unix vs Mac
Pong in GameEngine
Calculator in GameEngine
Rock-Paper-Scissors in GameEngine
Hangman with better graphics
Lesson #10:
Lesson #11:
Lesson #12:
Lesson #13:
Lesson #19: Extras

Build Your Own Game in Java
Programming Tic-Tac-Toe

Things You Need to Know in Java
Trouble-Shooting GameEngine
Useful Tech Issues
Converting Your Game to JavaScript
Why 6? Why Not Objects? Why Java?
Flat vs the Real World

Next: Programming Environment

<<Previous | ToC | Next >>

Revised: 2021 April 10