The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to create and initialize List or ArrayList in one line in Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 426
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to create and initialize List or ArrayList in one line in Java Posted: Dec 5, 2012 9:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to create and initialize List or ArrayList in one line in Java
Feed Title: Java67
Feed URL: http://java67.blogspot.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
creating and initializing List in same time
Sometime we want to create and initialize List like ArrayList or LinkedList in one line much like creating array and initializing it on same line. If you look Array on Java programming language you can create and initialize both primitive and object array e.g. String array very easily in just one line but in order to create a List equivalent of that array, you need to type lot of code. This is also one of the tricky Java question some time appears in Interview as Write Java code to create and initialize ArrayList in same line. In this Java tips we will see this trick which allow you to create and initialize List much like an Array. This tip can also save lot of time while creating test program or quickly trying some stuff.
Read more ยป

Read: How to create and initialize List or ArrayList in one line in Java

Topic: ADT Bundle โ€“ Just a single step to setup android development environment Previous Topic   Next Topic Topic: Using Cryptography in Java Applications


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us