About 1,660,000 results
Open links in new tab
  1. Java Strings - GeeksforGeeks

    May 6, 2025 · Java provides a robust and flexible API for handling strings, allowing for various operations such as concatenation, comparison, and manipulation. Example: String name = …

  2. Learn How to Declare String in Java with Examples - Edureka

    Feb 13, 2025 · A string is an object that represents a sequence of characters. Read this article and know how to declare string in Java with examples.

  3. Java - Create a new String instance with specified length and …

    Nov 26, 2009 · String s = String.format("%0" + length + "d", 0).replace('0', charToFill); This creates a List containing length-times Strings with charToFill and then joining the List into a …

  4. Java Strings - W3Schools

    There are many string methods available, for example toUpperCase() and toLowerCase(): The indexOf() method returns the index (the position) of the first occurrence of a specified text in a …

  5. String (Java Platform SE 8 ) - Oracle Help Center

    The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a …

  6. Java String Tutorial - HowToDoInJava

    Aug 15, 2024 · Learn to create strings, methods, comparisons, formatting and various conversions with simple and easy to follow Java examples. A String in Java represents an …

  7. JavaString Class and Methods with examples - BeginnersBook

    Oct 25, 2022 · There are two ways to create a String in Java. String literal; Using new keyword; 1. String literal. A string literal is a sequence of characters enclosed in double quotation marks (” …

  8. String Initialization in Java - Baeldung

    Jan 8, 2024 · First, let’s just declare a String, without assigning a value explicitly. We can either do this locally or as a member variable: String fieldString; void printDeclaredOnlyString() { …

  9. Java String: A Guide to String Basics, Methods, Immutability ...

    Java's String class, part of the java.lang package provides various methods to perform different operations on strings, such as trimming, replacing, converting, comparing, and more. Let's …

  10. java - Passing a string to a function - Stack Overflow

    I am just passing a String object to a function but the result is weird. I supposed that because I am passing an object(by reference) the result should have be " Here" and not "Hello". Why is this …

Refresh