The java Platform The Java platform is a software-only platform that runs on top of other hardware-based platforms The Java platform has two components The java virtual machine The Java Application Programming Interface(APD myprograll. java Java A門 Java virtual Machine >Java Platform Hardware-Based Platform
16 The Java Platform • The Java platform is a software-only platform that runs on top of other hardware-based platforms. • The Java platform has two components: – The Java Virtual Machine – The Java Application Programming Interface (API)
JavaⅤ irtual machine A Java virtual Machine(Jvm)enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode
17 Java Virtual Machine • A Java Virtual Machine (JVM) enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate language commonly referred to as Java bytecode
Java Platform Platforms J2SDK J2EE J2ME Core/ Desktop Enterprise/ Server Mobile/wireless Application, Applet JSP/Servlet eB Mi/et(ce∥ Phone/pDa) Swing, Awt Borland JBuilder IBM WebSphere, WSAD Nokia, motorola JCreator, or Text Siemens sdK Editor BEA WebLogic, Workshop Sun One studio J Builder Sun one Studio Oracle JDeveloper 18
18 Java Platform Platforms J2SDK J2EE J2ME Core/Desktop Application,Applet, Swing, Awt Enterprise/Server JSP/Servlet, EJB Mobile/Wireless Midlet (Cell Phone/PDA) Borland JBuilder, JCreator, or Text Editor IBM WebSphere, WSAD BEA WebLogic, Workshop Sun One Studio Oracle JDeveloper Nokia, Motorola, Siemens SDK JBuilder,Sun One Studio
Difference between java and c Java is derived from c Many of its syntactic characteristics are similar to C However, there are some huge differences
19 Difference between Java and C • Java is derived from C • Many of its syntactic characteristics are similar to C • However, there are some huge differences
Expressions Arithmetic operators are the same /,号,++ Numerical type conversion is mostly the same Java spells out divide by zero, NaN(not a number, etc. c& ctt are machine dependent 20
20 Expressions • Arithmetic operators are the same:– +, –, *, /, %, ++, –– • Numerical type conversion is mostly the same – Java spells out divide by zero, NaN (not a number, etc.) – C & C++ are machine dependent