• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Home
  • Blog
  • Sample Page

WordPress Tips

Just another WordPress site

Difference between Arrays.asList(array) Vs. ArrayList(Arrays.asList(array)) in Java

August 30, 2017 Leave a Comment

In java what is a difference between List Vs. ArrayList? In other words, have you ever wondered what is the difference between Arrays.asList(array) and ArrayList<Integer>(Arrays.asList(array))? This one is a simple Java program which demonstrates the difference between both, i.e. List Vs. ArrayList.

Let’s take a look at both statements first:

crunchifyList1 = new ArrayList<Integer>(Arrays.asList(crunchifyArray));

Here crunchifyList1 is of type ArrayList.. Very simple.

crunchifyList2 =

Filed Under: arraylist, Java & J2EE Tagged With: arraylist, Java & J2EE

Reader Interactions

Related Posts

  • Simplest way to generate logs in Java using java.util.logging’s SimpleFormatter and XMLFormatter
  • Microsoft Azure Translator Text API Java Tutorial (v3.0) & Azure SignUp Process
  • How to fix java. lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext Exception?
  • Java 11 and How to fix java.lang. TypeNotPresentException: Type javax.xml.bind.JAXBContext Exception?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Copyright ©2019 · WPress.Tips - All Rights Are Reserved · Powered by Genesis Framework