Monthly Archives: November 2019

convert string to string array in java

In this article, you will learn how to convert string to string array in java. Let’s assume string is “Welcome to selenium99 automation tutorials”. It consists of 5 parts/words. Each word is separated by a space. 1 First we will split the string and assign it to a string array. 2 Print the each index… Read More »

how to find common elements in arraylists java

You were given two arraylists as below and you have to identify the common elements present in them. ArrayList1: [sleenium99, automation, tutorials, java] ArrayList2: [arraylist, sleenium99, automation, tutorials, collections] Output is: [sleenium99, automation, tutorials] Method 1: We are going to achieve this task with the help of retainAll method present in the ArrayList.

Output:… Read More »