Skip to content

Tag Archives: Java-Strings

Suppose we have given a string in which some ranges as specified and we have to place the numbers which is between the given range… Read More
The valueOf() method converts data from its internal form into a human-readable form. It is static method that is overloaded within string for all of… Read More
Write a Java program to count the characters in each word in a given sentence?Examples:   Input : geeks for geeks Output : geeks->5 for->3 geeks->5… Read More
Write a Java Program to Swap first and last character of words in a Sentence as mentioned in the example? Examples: Input : geeks for… Read More
Prerequisite : String Comparison in Java 1. What should be the output of this program? class GeeksforGeeks {     public static void main(String args[])     {         String… Read More
Prerequisite : Basics of Strings class in java 1. What is the Output Of the following Program class demo1 {     public static void main(String args[])… Read More
Given a string str with uppercase, lowercase and special characters. The input string is to end with either a space or a dot. The problem… Read More
Mobile Number validation criteria: The first digit should contain number between 7 to 9. The rest 9 digit can contain any number between 0 to… Read More
String Interning is a method of storing only one copy of each distinct String Value, which must be immutable. By applying String.intern() on a couple… Read More
Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object class, henceforth it is a child… Read More
In this article, we will discuss how we can compare two strings lexicographically in Java. One solution is to use Java compareTo() method. The method… Read More
We are given a list of words sharing a common stem i.e the words originate from same word for ex: the words sadness, sadly and… Read More
Predict the output of the program import java.util.Random; public class GFG {     private static Random rd = new Random();      public static void main(String[] args) {… 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
Both equals() method and the == operator are used to compare two objects in Java. == is an operator and equals() is method. But ==… Read More

Start Your Coding Journey Now!