Java 1.4.1
- the focus was on quality
- more than 2000 bug fixes
- Garbage Collection(GC) Mark sweep and parallel going space
Java 5.0
- Community Development
- 15 JSRs
- Bug fixes
- Performance
- JMX, Decimal Arithmetic, Generic types...
- Quality
- Performance
- Monitoring
- Desktop Client
- Easy development
- Tighter control
- Bug fixes
- Compatibility
- Reliability
- Scalability
- Big Heap support- Concurrent and Parallel GC
- Hotspot virtual support
- Chipset optimizations
- AMD4 native compilers
- Hyper Threading
- Faster startup: Especially desktop apps-AWT, Swing
- Generated at install time'
- Originally developed on Apple
- Minimum memory footprint
- Reduced startup time
- Less reliance on command line tools
- More support for Adaptive fine tuning
- Tools: Jstat,Jvmstat
- (In 1.4.2)2 different compilers: Client and Server
- (in 1.4.2)Hot Spot client-default
- In 5.0 Good out of box performace without fine tuning.
- Parallel GC
- Server Hot Spot VM
- Max heap 1/4, Max Memory 1.6
- Initial heap 1/64 Max mem or max heap
- Minimum heap,
- Serial GC,
- Client Compiler
- Visual GC - Graphical view of VM
- Low memory detection
- Allow access of internal VM status
- Heap size, GC info, Threads, etc
- SNMP, JMX based
- Plugs into JMX console
- JMX Api JSR003
- MBean Server part of JMX
- Easy to configure
- Improved performance analysis
- JVMTI replaces JVMPi
- Bytecode instrumentation
- HProf updated to JVMPi
Improved Diagnostic Ability
- Static trace Api
- Fatal error handler
- Start JVM with OnError Options
- Java debug interface SA Connector
- Attach connector to code file
- Java Webstart- Unified Console plugin and console
- Continued quality and performance
- Gnome skins
- Synth Skinnable API
- Ocean
- Concurrent Library (JSR 166)- Dough LEA
- XML, Webservices support
- Language Changes.
- Locking API, Higher level abstractions
- Atomic variables
- Thread executors and pools
JSR 206 JAXP 1.3
Java Web Services Standards
- XML 1.1 and namespace
- XML Schema
- DOM, SAX
- JAXRPC
- SAAJ
- JAXB
- XML Security
- Encryption and Digital Signatures
- JAXR
Language Changes
- Generics
- Loop- For Each
- Autoboxing/unboxing
- Typesafe enums-Complie time
- Varargs
- Static imports
- METADATA
- easy to code
- Simpler to Visualize, Readable
- Minimize compatibility Issues
- Abstract over types
- Casting is a pain
- Casting is unsafe
- Casting may fail at runtime
- Nice to Tell compiler type of Casting
- Signature changes
- List
{
List
Copy (List
}
Generics vs Template
- Generics- type checked
- Generics-coded once and for all
- Generics-no code bloating
- Generic code not exposed to user
- No hideous complexity
- Common cut and paste error
{
((TimerTask)o)Cancel();
}
Autoboxing/Unboxing
Typesafe Enum Pattern
Consider:
int enum pattern
public static final int SEASON_WINTER=1
enum color("blue", "green", "red");
enum Suit ("club", "Spade", "Diamond", "Heart");
enum rank("ace","two"..):
for (Suit suit:Suit.Values)
for(Rank rank: Rank.Values)
VArgs
public static String format(pattern, Objects ...arguments);
Static Imports
import static ...enum.*
Metadata
import javax.xml.rpc.*
public class CoffeeOrder{
@remote public coffee[] getPriceList(){
}
}