Wednesday 11 May 2016

Java Tutorial : Java Autoboxing (list)


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) 
AutoBoxingDemo.java
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());
    }

}
Output
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
class java.lang.Integer
Click the below link to download the code:
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:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment