Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
Java Language EssentialsDownload tutorial zip fileEmail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
Course Notes
  


Program organization page 30 of 37


A COBOL program is divided up into four divisions:

  1. IDENTIFICATION DIVISION. Defines the name of the program
  2. ENVIRONMENT DIVISION. Defines computer-specific environment details
  3. DATA DIVISION. Defines variables, input/output formats, constants, and work areas (storage space)
  4. PROCEDURE DIVISION. A group of procedures (paragraphs) that do the work of the program

COBOL programs explicitly separate the data and procedures that operate on the data. Procedures are called methods in the Java programming language.

Most COBOL statements are divided up into "area A" (four characters wide starting from left edge) and "area B" (the rest of the line). All this means is that the division, section, paragraph, and 01 level data start in A and the executable statements start in B. The Java programming language compiler has no such formatting restrictions that impart meaning and ignores white space for the most part. Also, the Java programming language is case-sensitive so that dog and Dog are totally different names.

Java programs are organized by units that correspond to entities in the real world: objects that encapsulate both the data and the methods to manipulate that data. Objects with the same characteristics and behavior are described by classes (storage templates) and correspond roughly to COBOL groups. A Java program is then primarily just a collection of class definitions such as:


class Vehicle {
  ...
}

class Car extends Vehicle {
  ...
}

class Truck extends Vehicle {
  ...
}

Program execution begins in the main() method of any of the classes in your program; you specify which class when you launch the program.


copyright 1996-2000 Magelang Institute dba jGuru


Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
PrivacyLegalContact