Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely.

Similar presentations


Presentation on theme: "CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely."— Presentation transcript:

1 CS-140 Dick Steflik Lecture 3

2 Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely accepted as the internet programming language 18 years old (1995) Compiled optimized for workstation usage derived from C Runs on hardware Poorer object model Widely accepted as workstation program- ming language 34 years old (1979)

3 The JDK What you get –Compiler (javac.exe) –Run time (JVM) (java.exe) –Javadoc – documentation tool –Jar – tool or making java archives –Keytool – for making public encryption keys –A bunch of mics tools –Java core libraries

4 The C++ Compiler Translates C++ source code into the machine language for the hardware platform –output of the compiler are object files (.obj) which are partially ready to run –object files must be linked together using the system linker to make an executable file (.exe).exe files are specific for the hardware platform C++ is portable only at the source level

5 The Java Compiler javac in the /java/bin validates java source code and syntax translates Java source code into java bytecodes –java bytecodes are the machine language for the Java Virtual Machine the JVM is a hypothetical machine that written mostly in Java but a little bit in C and is compiled specifically for various platforms (Windows, Sun, HP, LINUX) Bytecodes are portable between platforms

6 Java Application Development Java Source File javac Java Class File JVM classpath base classes Compile into bytecodes Run the program

7 Java import statements imports indicate which parts of which java packages an application will need at run time –also allows the compiler to run to completion and not indicate that the class isn’t part of the file being compiles Remember the compiler only works with the file being compiled

8 Java application is defined as a class that is instantiated when the program is run main() is the name of the function to be run initially A constructor is used to initialize the class

9 Java - HelloWorld public class HelloWorld { public static void main(String args[]) { System.out.println(“Hello World”); }

10 Eclipse A general purpose GUI for software development –Used for Java, C, C++ Eclipse integrates the Java compiler, the Java run-time and an editor together into a what looks like a single tool Anything you can do in Eclipse can be done with the command line tools that come with the JDK and your OS (sometimes easier) We will look at both ways (Eclipse and Command Line)


Download ppt "CS-140 Dick Steflik Lecture 3. Java C++ Interpreted optimized for the internet Runs on virtual ized machine Derived from C++ Good object model Widely."

Similar presentations


Ads by Google