java hosting

horsebig.gif (6904 bytes) drivehead.gif (2283 bytes)

Okay, saddle up folks. We're gonna git some real life experience writin' actual java code! Before you get going, you should read about the cattle drive. It explains a few things worth knowin!

Here we go!

Read the Java programming tutorials, find Java programming examples and learn some Java programming basics in the cattle drive

book book
Get the book Just Java 2 by Peter van der Linden.

Download the Java SE Development Kit 7 from Sun. If you are trying to learn Java you shouldn't use an IDE. Otherwise, you learn the IDE instead of learning Java. I generally use the JDK for all of my Java work.

It is possible that once you have installed the JDK, everything will work fine as is. If you are not one of the lucky ones, you may need to adjust your PATH and CLASSPATH environment variables. Instructions are included with the JDK and help specific to you can be obtained at the campfire in the Cattle Drive (java college) forum.

I put all of my stuff into a directory called java (off of my root, C:\, in Windows and off of my home directory in unix). On my windows machine, my PATH includes

and my CLASSPATH is set to

".;C:\JAVA" (notice the dot before the first semicolon)

Here is a program that you can cut and paste to make sure that you have everything set up correctly. Make sure you put it into a file called (case is important! even on Windows computers):

  public class HelloWorld
      public static void main( String[] args )
            System.out.println("hello world!");

Make sure that you paste this into a text editor (like notepad) and not a word processor. A word processor will stick a bunch of extra formatting text into the file.

Pull up a console (DOS) or terminal window and put the file into your java directory. Make the java directory your current directory. Type


and press enter. Remember: case is still very important, even on Windows computers. If the program compiles without flaw, you will get your command prompt back. Otherwise, go to the Cattle Drive (java college) forum and tell us what went wrong.

To run your program, type

 java HelloWorld 

and press enter. You should then see "hello world!" on your screen. If you don't, post a message on the Cattle Drive (java college) forum.

JavaRanch Cattle Drive - Java Fundamentals

Read chapters 1 and 3 in "Just Java 2".

Chapter 1 will give you a good overview of what Java is all about. Chapter 3 is going to give you an idea of the nuts and bolts of Java. The chapter mentions "unicode" - this can be tough reading for a beginner. It also covers autoboxing and unboxing (new in Java 5). You don't have to memorize this stuff, just kinda browse it. Most of the chapter is about the different primitive types (I like to call them the atomic types). This is stuff you really need to be familiar with. You might want to read the section on Strings twice! You can just browse the sections on byte, short and float since you won't be using those types for a while.

After the first couple of assignments, you will want to read chapters 4, 7, and 9.

Chapter 4 will introduce you to branching constructs and how to organize your statements. Just browse the stuff on "do..while" and "continue" - you should know that it exists, but I don't want you to use it.

Chapter 7 will have a thorough introduction to identifiers, and operators. Make sure you thoroughly understand comments. Browse the keywords. There will be some discussion on classes and objects - don't get too concerned with that yet. We'll cover that later.

Chapter 9 talks a bit about arrays. Stop at the part about the Math package. We'll look into that later.

You may want to go to Sun's JDK Class Documentation (API) and make a bookmark. You don't want to read all this stuff now, but later you will want to go look stuff up.

Make sure you have read the Style Guide before sending me your completed assignments.

Have you read about the Cattle Drive yet? Yep? Then let's git them dogies movin'.

Here are your assignments:

Assignment Java-1 (Hundred)

Assignment Java-2 (EvenOrOdd)

Assignment Java-3 (Leap)

Assignment Java-4 (Say)

Assignment Java-5 (Times)

Assignment Java-6 (Grains)

Assignment Java-7 (Sum)

Assignment Java-8 (GeekWatch)

JavaRanch Cattle Drive - Classes and Objects

Assignment OOP-1 (DaysOld)

Assignment OOP-2 (NaturalLanguageMultiply)

Assignment OOP-3 (SortNames)

Assignment OOP-4 (Lookup)

JavaRanch Cattle Drive - Servlets

Assignment Servlets-1 (NowServlet)

Assignment Servlets-2 (ReverseServlet)

Assignment Servlets-3 (Reverse2Servlet)

Assignment Servlets-3b

Assignment Servlets-4a (Videos)

Assignment Servlets-4b

JavaRanch Cattle Drive - JDBC

Assignment JDBC-1

Assignment JDBC-2a

Assignment JDBC-2b

Assignment JDBC-3a

Assignment JDBC-3b

Assignment JDBC-4

Page maintained by Marilyn de Queiroz

Playtime diversion: Paul Wheaton, who wrote the original Java College, now dabbles in permaculture. He's a certified master gardener and has written articles on organic lawn care, proper use of diatomaceous earth and a new way of raising chickens. His research into less toxic living prompted him to write about using cast iron skillets and a healthier way to control fleas in the home.

You can follow Paul's future work on his permaculture blog, his Missoula blog or by following his permaculture podcasts or permaculture videos.