The diamond operator is one of the new features of Jdk 7. Please make sure you have jdk version 7 or not. Here is an example of a diamond operator.
Here is the assignment operator:
Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
With a diamond operator:
Map<String, List<String>> anagrams = new HashMap<>();
Edit
Add this to your build.gradle ..
android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 14 targetSdkVersion 21 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } }
Hope this will be helpful for you.
Arkar aung
source share