Tag: string
How to Store Multiple Data types In An ArrayList
So, how to store objects of multiple data types in the ArrayList, in fact storing is pretty simple, every one will get some idea but how to retrieve the values ? for example if we have 100+ values in…
How to Convert String to char Array in Java
In java we have built-in function String.toCharArray() to convert String to char array. But for sure in the interviews they will ask you to write a program to convert string to char array without using the built-in functions 🙂…
How to Convert String to int in Java
In Java we can convert string to integer with Integer.parseInt() function. Java String to int Example public class StringtoInt { public static void main(String args) { String str = “4”; int in = Integer.parseInt(str); System.out.println(in); } } Output: 4…
How to Convert String Array to List in Java
Its very often scenario to convert String Array to list in real time projects . In java we have inbuilt function to convert String array to List. Syntax: Arrays.asList(“Input String array“); Java String Array to List Example import java.util.Arrays; import java.util.List; public…