Posts Tagged ‘arraylists’

Convert Arrays to Set in Java

Java Collection API is one of the most useful APIs used in any Java application. In my day to day Java coding routine, I have to deal with these APIs quite often.However sometime while working with Collection API, lot of developers end up writing unnecessary and mostly inefficient code. For example, to convert an Java ...

Java Tip: How to Sort Arrays in Java using java.util.Arrays class

Here is a small but very useful tip that every Java programmer should be aware of. Have you ever tried sorting arrays in Java? Well, java.util.Arrays class has built in method to make your job easy. You can use following method to sort any array in Java.import java.util.Arrays; ... ... Arrays.sort (int ) Arrays.sort (float ) Arrays.sort (long ) ...Let us check an example were we will sort an array of ...

Convert ArrayList to Arrays in Java

A lot of time I have to convert ArrayList to Arrays in my Java program. Although this is a simple task, many people don't know how to do this and end up in iterating the java.util.ArrayList to convert it into arrays. I saw such code in one of my friends work and I thought to share this so that people don't end up writing easy ...
Copyright © 2012 ViralPatel.net. All rights reserved.