COBOL to Java: Tips and hints for learning Java

Last Update: 24 May 2003

Kris' Java Diary
> COBOL to Java: Tips and hints for learning Java
Kris' Java Exercises
Kris' JSP Exercises
CIST2535 Class Homework

This is a work in progress - I'm just getting started! Here is a list of tips and hints which I found helpful on my way from COBOL programmer, to becoming a Java programmer.

I have more than 15 years of mainframe, COBOL, DB2, IMS, programming and systems analysis experience. Several of the companies I have done work for have started retrofitting Java front ends onto legacy COBOL systems. IBM has made a commitment to Java, so it is only going to get easier to mix Java with legacy COBOL and databases.

I am trying to learn Java because I can use it both on my own website (here you are on it!) and also, hopefully, at work. Java is a good way to build GUI systems which are often (but not always!) nicer than old text-only systems. Since Java programs are stored on the server there isn't the issue of rolling out updates that there was for client-side GUI programming in Smalltalk and the like. And Java, at least theoretically, is platform independent so systems can be used by both local and remote employees, and also outside customers via the internet. Cool!

Back to Kris' Java Diary

Getting Started You do not need a fancy development tool. Java can be coded in a basic text editor, then compiled and run from a command line. You do need to have a compiler. You can download the SDK or JDK for free from Sun, or it is sometimes included on the CD ROM with some Java books. Mac OS X comes with a built in compiler. Fancy packages such as CodeWarrior and the like add the problem of learning the tools on top of learning Java. I recommend holding off on using development environment packates until you know Java.

Java is completely different than coding COBOL. I strongly recommend taking a Java class at your local technical college or extension service. I bought several books and a Java development kit and couldn't get anywhere on my own. In contrast, I was able to teach myself HTML, JavaScript, and the other tools I needed to do web programming all on my own. Java object oriented coding syntax is so different from COBOL and there are many tools you need to coordinate in order to code and run Java that it was just too hard to do it alone.

Source Code You can write and edit source code in any basic text editor. The filename you save must end with ".java". Eg: my_program.java. The program name should also match the name of the public class in the program, if any.
Compiling From the command line type "javac my_program.java". The compile output will be a compiled class named "my_program.class".
Running From the command line type "java my_program". Do not include the ".java" or ".class" suffix.
Books (programming) David Flanagan "Java in a Nutshell"
Pay attention to the edition and the version of Java which is covered. As of 24 May 2003, I'm using the fourth edition which covers Java 1.4.
Books (Sun Exam) Kathy Sierra and Bert Bates "Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)"
Websites (programming) I found very little very basic, beginner level information available on the web for Java. Every book I found also completely skipped such basic details as how do you edit, compile, and run a simple program. Yeah, this information is in part specific to your machine since you need to have a compiler installed, but hey, without it you can't do anything so how can they skip that stuff?
Sun Certified Programmer for Java 2 (Exam 310-035)
  • Learn basic java and object oriented (classes) syntax. See David Flanagan "Java in a Nutshell"
  • Prepare specifically for the exam. See Kathy Sierra and Bert Bates "Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)". Pay attention to the edition and the version of Java which is covered. Exam 310-035 covers Java 1.4, but in the future there might be a different exam to cover a more recent version of Java. This book is everything you need to pass the Sun Java Programmer Certification Exam. The self-study questions closely match the difficulty of the exam.
  • Take a coupla practice exams. See http://www.jchq.net. Caution: the practice exams on this site seem to target a previous version of the exam which includes some topics which are no longer covered and excludes new topics which have been added to the latest version.

Back to Kris' Java Diary


Comments | Doug and Kris' Home Page | Kris' Page | Doug's Page | Site Map