WHAT IS JAVA
- A Programming Language (object-oriented)
- A Development Platform (SDK)
- A Runtime Environment (JRE)
HISTORY
- Green Team (consumer devices)
- Project Oak (embedded devices)
- Java Platform (web browsers)
- Mobile (ME), Standard (SE), Enterprise (EE)
- Current Java SE 7
JAVA GOALS
- Simple, Object-oriented, Dynamic
- Architecture neutral, Portable
- Robust, Secure
- Distributed, Multithreaded
The JAVA PROGRAM
- Written using IDE or Text Editor
- Compiled to Bytecode using the java compiler
- Packaged to JAR (archive) using the jar tool
- Executed in JVM (virtual OS) using the java command
WRITE ONCE, RUN ANYWHERE
The Java Virtual Machine
- Sandbox = safe environment for executing Java code
- Liaison = converts bytecode to native code for host OS
- Interpreted = line-by-line conversion, not efficient
The Just In Time Compiler
- First usage absorbs compilation overheads
- Subsequent usage shows performance benefits
- Not all Java code can be optimized this way (e.g., Reflection)
SETUP CHECKLIST
- Install the Java SDK for your host OS
- Install an appropriate IDE (we'll use Eclipse)
- Verify install with simple program
OVERLOADING METHODS, CONSTRUCTORS
THROWING AND CATCHING EXCEPTIONS
PREVENTING NULLPOINTEREXCEPTION
NESTING (CHAINED) EXCEPTIONS
CLIENT SERVER PROGRAMMING
ENTERPRISE JAVA BEAN PROGRAMMING
JINI JAVASPACES PROGRAMMING
CREATING CUSTOM ANNOTATIONS
LIBRARIES, EXTENSIONS, FRAMEWORKS