1 / 5

Overview of Java

Overview of Java. CSCI 392 Day One. Running C code vs Java code. C Source Code. Java Source Code. C Compiler. Java Compiler. Object File (machine code). Library Files. Java Byte Code. Java Platform (API). Linker. Java Virtual Machine (interpreter / JIT compiler).

Download Presentation

Overview of Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overview of Java CSCI 392 Day One

  2. Running C code vs Java code C Source Code Java Source Code C Compiler Java Compiler Object File (machine code) Library Files Java Byte Code Java Platform (API) Linker Java Virtual Machine (interpreter / JIT compiler) Executable File (machine code) portable between machine types

  3. Java Design Features • Byte Code is machine independent • Network-Centric • provides OS-type services • security is a fundamental concern • Java 5.0 includes 3562 classes in 166 packages, including support for • client-server operation • concurrency • parsing web data • etc

  4. Hello World 1.0 class hello { static void main (String[] args) { System.out.println("Hello World"); } } $ vi hello.java $ javac hello.java $ ls hello.class hello.java $ java hello Hello World

  5. Hello World 1.1 public class hello2 { public static void main (String[] args) { int num_loops; // numbers of hellos to print // test the user input if (args.length != 2) { System.out.println("Usage Error: java hello2 name count"); return; } // convert the command line arg from string to int num_loops = Integer.parseInt (args[1]); // print the hellos for (int i=0; i<num_loops; i++) System.out.println("Hello " + args[0]); } }

More Related