How to convert an array to a List / Various ways to convert an array to a List

Why Convert?

There are many situations when you have an array and you want its elements in the form of a collection. One such common example is that suppose you have an array of integers or string elements and you want to check the presence of an element in it. If the elements are in a List, it is pretty easy to do that by calling contains method on the list. There is no direct way of doing this with an array. You have to iterate over the array and compare every element with the value to be checked.

(more…)

Continue Reading

How to read CSV file in java / Various ways to read a CSV file in java

What is a CSV file

CSV stands for Comma Separated Values. Thus each line of CSV file contains words that are separated with a comma (,). A CSV file is different from a normal text file in a manner that a normal text file has a space as a separator while a CSV file has a comma as a separator. A CSV file is stored with a .csv extension.

Reading and parsing a csv file involves reading its contents line by line and processing each line. Processing might mean using its contents to do a task or just printing it to the console. Since a csv file is a normal text file, it can be read in the same way as a text file is read in java.

(more…)

Continue Reading
Close Menu

Never Miss an article !

Get the new post delivered straight into your inbox, enter your email and hit the button

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

codippa will use the information you provide on this form to be in touch with you and to provide updates and marketing.