Articles, Home

Reverse string in Java using recursion – HowToDoInJava

In this post, we will see a Java program to reverse a string using recursion. Also learn to reverse string without recursion as well. Read More: Reverse words in a string in Java 1. Reverse a sentence in Java using recursion To reverse a string by characters, we can write a recursive function which will …

Articles, Home

Java array contains – arraylist contains example – HowToDoInJava

Learn how to check if an arraylist contains a value in Java with example. Also, learn to check if array contains an element, along with index of element in array. 1. Java ArrayList Contains Example To check if an ArrayList contains an element, use ArrayList.contains(element) method. contains(element) method does not take null argument, and will …