Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News

Similar presentations

Presentation on theme: "A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News"— Presentation transcript:

1 A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News

2 Java - Introduction (c) 2 Purpose ñ There seems to be a wall between the old mainframe guys and the new Javaworld ñ The wall is artificially created using buzzwords as the building blocks ñ Our objective is to remove this wall ñ Course will focus on where Java approach differs from our traditional programming

3 Java - Introduction (c) 3 Java - Topics –Buzzwords and the Reality –Basic Data Structures in Java –JSDK from Sun –Arrays –OOP Basics, Classes and Methods –Constructor –File Handling -I/O- Data Streams –GUI - AWT and Swing Components –Method Overloading, Polymorphism –Applets –IDEs - Intgrated Development Environments

4 Java - Introduction (c) 4 What is Java? ðJava: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, dynamic language --Sun Microsystems ð The words have been faithfully copied from the original article by James Gosling (1995) ð Simple meant simpler than C++! Gosling never intended to compare with other platforms or languages!

5 Java - Introduction (c) 5 A more realistic definition: ð A C++ like OO language that has a readable syntax and acceptable performance designed to run on several modern platforms. ð eg: applications servers, web servers, web browser (embedded in), Mobile phones and ordinary Windows applications

6 Java - Introduction (c) 6 Evolution of Java ð James Gosling, Arthur Van hoff, Andy Bechtolsheim. The Original Team in Sun ð Originally designed to work in appliances ð Mutated to a web browser environment (client) ð Mutated from there to server software, where it can run on many back-end server platforms without worrying about GUI compatibility problems

7 Java - Introduction (c) 7 Java Syntax ð Language syntax itself is simple ð Data type declarations, mathematical operations, array definitions, if-else, for loop, do-while etc are not complex ð Easier than C++ ð Though a few idiosyncracies inherited from C++

8 Java - Introduction (c) 8 Sample Program /** Hello World in Java */ public class HelloWorld { public static void main (String args[]) { System.out.println("Hello S212 World!"); } // end of method main } // end of class

9 Java - Introduction (c) 9 Mechanics /** * */ public class HelloWorld extends Object { public static void main(String arguments[]) // Where the program starts { System.out.println(Hello World"); // Print out message } Comments Class name (MUST match file name) Main method (starting point) Line comment Braces {} - start & end of class and methods

10 Java - Introduction (c) 10 Classes and Methods We see that Java programs are organized as classes and methods All Java programs start with a class definition Classes contain one or more methods

11 Java - Introduction (c) 11 Compilation Source code is translated to an intermediate byte code The byte code is run in a Java Run Time System which is normally known as JVM = Java Virtual Machine Source Code Byte Code Java Virtual Machine Javac - the compiler from Sun HellloWorld.class suffix Run time

12 Java - Introduction (c) 12 JSDK – Development Kit ñ Standard Edition is free - from Sun ñ Contains compilers like ñ - Javac - compile ñ - Java - execute ñ - appletviewer – run applets ñ - Javap – dis-assembler ñ - Javadoc - created html based doc ñ - Jar – Java Archive Tool (ZIP) ñ - many smaller tools...

13 Java - Introduction (c) 13 JSDK ñ Good ñ Unlike C, others vendors didnt bother to make their own compilers – one is enough! ñ Easy to install and run ñ Documentation available from sun (zip format) ñ Missing : Sun failed to give a simple editor and test environment; One must go to DOS! And use an editor made by Mr Nobody!!!

14 Java - Introduction (c) 14 Java vs C 4 Java was designed for a specific purpose 4 C is a more general purpose closer-to- machine language 4 Java does not produce machine code; interpreted by the Java Run Time (JVM) 4 C produces executable code (*.exe) which can be run as it is

15 Java - Introduction (c) 15 Recap ñ Java is an Object Oriented language suitable for Web and Server based Windows applications ñ Java SDK from Sun gives you the compiler and Runtime for Java ñ Its all about classes and methods

Download ppt "A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News"

Similar presentations

Ads by Google