CppBuzz.com
  
Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » Forum » x-Forum » Question

How List data type work in Java please share one example

I want program on List with better examples

Posted by Asif007 2018-09-12 20:09:13

Hi Asif, 
this is one example

import java.util.*; 

public class Main
{
	public static void main(String[] args) {
	    List<Integer> mylist = new ArrayList();
	    mylist.add(5);
	    mylist.add(15);
	    mylist.add(25);
	    System.out.println(mylist.size());
	}
}

C++ user image admin posted 2018-09-12 20:15:08

Thanks for your post

C++ user image Asif007 posted 2018-09-12 20:18:20

Your Answer


Ask New Question