Click here to watch in Youtube :
https://www.youtube.com/watch?v=5sN2E4cJJ7w&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java Autoboxing (list) |
Java Tutorial : Java Autoboxing (list) |
import java.util.ArrayList; import java.util.List; public class AutoBoxingDemo { public static void main(String[] args) { List<Integer> li = new ArrayList<>(); for (int i = 1; i < 20; i += 2) { li.add(i); } System.out.println(li); System.out.println(li.get(0).getClass()); } }
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19] class java.lang.Integer
https://sites.google.com/site/javaee4321/java/AutoBoxing_Demo_List_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/AutoBoxing_Demo_List_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/c539eeaf4c6ff331d8e2aa2333826ea70c999093/BasicJava/AutoBoxing_Demo_List_App/?at=master
See also:
No comments:
Post a Comment