skip to main content

Converting Java Source Code to Object-oriented COBOL

Converting Java Source Code to Object-oriented COBOL
Introduction
The Java world offers many objects that can be integrated into your application enhancing it with additional features.
Sample Java code snippets and/or programs are provided as samples for most of these objects.
There are two ways to take advantage of these objects in a COBOL application:
1.
2.
This article describes the second option providing suggestions for converting a Java source code example into the equivalent OOP COBOL code.
The COBOL code is usually easier to maintain because:
1.
2.
To convert a Java code example to the equivalent COBOL code, we’ll demonstrate how to read the content of a web page.
Here is a Java example that does the job:
 
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class webcontent {
   public static void main(String[] args) {
   try {
       URL url = new URL("http://www.veryant.com");
       new BufferedReader(
       new InputStreamReader(uc.getInputStream()));
       while ((inputLine = bf.readLine()) != null) {
          System.out.println(inputLine);
     } catch (Exception e) {

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left