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, 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" 

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:

Breakfast for Champions, You Already Know How (Six Principles)
Tell the Computer What to Do, your first steps at controlling the computer (Chomp) (Chomp series needs revision)
Begin 0: Telling the Computer What to Do
Begin 1: Remembering What You Told the Computer to Do
Begin 2: What You Can Tell the Computer to Do
Begin 3: What You Can Tell the Computer (Sequence and Iteration)
Begin 4: Tell the Computer in Numbers (and Variables)
Begin 5: Tell the Computer to Choose (Conditionals)
Begin 6: Tell the Computer to Build a Maze
Begin 7: Tell the Computer to Do Something then Come Back (Subroutines)
Begin 8: Tell the Computer What It Doesn't Know (Input) (Input and Output)
Begin 9: Telling the Computer in a Language
Introduction & ToC (you are here)
Lesson #0: Programming Environment
Lesson #1: Sequence & Output
Lesson #2: Variables & Expressions (Strings)
Variables & Expressions (Numbers)
Controlling Chomp from Java
Lesson #3: Conditionals & Input
Using the BlueJ Debugger
Lesson #4: Iteration
Rock-Paper-Scissors Game
Lesson #5: Arrays
Lesson #5: Subroutines & Recursion
Lesson #6: Classes & Objects
Lesson #7: Extras

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

Next: Programming Environment

<<Previous | ToC | Next >>

Revised: 2020 September 17