Category: Java Programs

Read Elements of ArrayList JAVA Example

There are three ways to Read Elements of Arraylist get()  method For-Each Loop Cursors (Iterator , ListIterator) get(int index)  method use to read single element from ArrayList. For-Each loop is used to traverse the ArrayList....

Array to Collection JAVA Example

In JAVA projects, It is very common requirement to convert an Array into Collection. This example demonstrate how can we convert an Array to ArraList (Collection). To get Array as List, JAVA provide asList(T a) ...

Simple Input Output Program in Java

JAVA provides different classes to get input from users. Here I’m using Scanner class that is most recommended class for user input.

Now you can compile and run this program in any Java...