Search code examples
javaandroidjava-7java-6

How does explicit type argument "<>" work on Android 4.1?


Hello I was getting a warning in my code like the one referenced below and it says this was introduced in java 1.7 so I removed it to get rid of the warning and tested my app on android 4.1 and it ran, to my knowledge android 4.1 uses jdk/jvm 1.6/6 so how is it possible this runs fine without warning ?enter image description here

ArrayList explicit type argument string can be replaced with <>?


Solution

  • Java 7 language features are just "translated" to Java 6. It's called desugaring in Android world.

    By the way, Java 8 is supported currently.