Download presentation
Presentation is loading. Please wait.
Published byCecilia Marsh Modified over 9 years ago
1
Overview of Java CSCI 392 Day One
2
Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File (machine code) Java Source Code Java Compiler Java Byte Code Java Platform (API) Java Virtual Machine (interpreter / JIT compiler) 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]); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.