Skip to content

Tag Archives: Java-String-Programs

Given a string str of some specific length, the task is to pad this string with the given character ch, inorder to make the string… Read More
Given a string str, write a Java program to print all words with even length in the given string. Examples: Input: s = "This is… Read More
Given a Float value in Java, the task is to write a Java program to convert this float value to string type. Examples:  Input: 1.0… Read More
Given a Short value in Java, the task is to convert this short value to string type. Examples: Input: 1 Output: "1" Input: 3 Output:… Read More
Given a Double value in Java, the task is to convert this double value to string type. Examples: Input: 1.0 Output: "1.0" Input: 3.14 Output:… Read More
Given a Byte value in Java, the task is to convert this byte value to string type. Examples: Input: 1 Output: "1" Input: 3 Output:… Read More
Given a String “str” in Java, the task is to convert this string to float type. Examples: Input: str = "1.0" Output: 1.0 Input: str… Read More
Given a String “str” in Java, the task is to convert this string to short type. Examples: Input: str = "1" Output: 1 Input: str… Read More
Given a String “str” in Java, the task is to convert this string to byte type. Examples: Input: str = "1" Output: 1 Input: str… Read More
Given a string str, the task is to check if this string contains only whitespaces or some text, in Java. Examples: Input: str = "… Read More
Given a string str, the task is to check if this string is null or not, in Java. Examples: Input: str = null Output: True… Read More
Given a string str, the task is to check if this string is empty or not, in Java. Examples: Input: str = "" Output: True… Read More
Below are the various methods to convert an Array to String in Java: Arrays.toString() method: Arrays.toString() method is used to return a string representation of… Read More
Strings in Java are objects that are supported internally by a char array. Since arrays are immutable, and strings are also a type of exceptional… Read More
A string is said to be a palindrome if it is the same if we start reading it from left to right or right to… Read More

Start Your Coding Journey Now!