What is diamond problem in java
When a Java class implements multiple interfaces you do run the risk of naming
clashes. A class can implement two interfaces that share the same method name
and return type
Example:
public interface GoodDriver {
public Boolean signalBeforeTurns();
}
public interface BadDriver {
public boolean signalBeforeTurns();
}
A class could not implement GoodDriver and BadDriver at the same time since
the return types of signalBeforeTurns() do not match.
So what's the solution? If you have access to the source code the best course of
action is to rename the methods in either of the above cases. If you don't have
access, you are stuck.
New Features in JDK 5
This section introduces you with the new features on Java 5. Here you will learn
about the exciting new additions to the Java language. After going through this page
you will better understand the features of Java 5.0.
Here are the list of new Features added to the JDK 5.
1. Metadata
2. Auto-boxing and auto-unboxing of primitive type variables
3. Var-args
4. Formatted Output using The printf Method
5. Formatted Input
6. Concurrency utilities
7. Scanners
8. Static Imports
9. Enumerated Types
10. Generics
11. JVM Improvements
12. Enhanced for Loop
13. RMI compiler-rmic
14. Class-data sharing
15. Monitoring
16. JVM Profiling API (JVMTI)
17. Improved diagnostic capability
18. Desktop Client
19. Core XML support
20. Supplementary character support
21. JDBC rowsets
In the future chapters we will give you examples that will show you how to really use
these features