🌐
W3Schools
w3schools.com › java › java_strings.asp
Java Strings
A String in Java is actually an object, which means it contains methods that can perform certain operations on strings. For example, you can find the length of a string with the length() method:
🌐
GeeksforGeeks
geeksforgeeks.org › java › strings-in-java
Java Strings - GeeksforGeeks
Each character in a string is stored using 16-bit Unicode (UTF-16) encoding. Strings are immutable, meaning their value cannot be changed after creation. Java provides a rich API for manipulation, comparison, and concatenation of strings. ... Note: The diagram conceptually shows the sequence of characters in a string, not its actual JVM memory layout. Since Java 9, Java uses Compact Strings (byte[] with ...
Published: 6 days ago
Discussions

ELI5:What is a "String" in Java/programming and why is it known as a "complex added type" and other variable are known as "primitive" ?
In simplest terms, a String is an collection (referred to in programming as an "array") of characters. If you wanted to have a String that said "Reddit", it would literally be an array of character values ['R', 'e', 'd', 'd', 'i', 't']. The most fundamental difference between strings and primitive types such as "int" are that primitives are single values. Strings are collections of values (specifically, a collection of characters.) Characters themselves are primitive types. In addition, primitive types are pieces of data. Strings are objects, which are instances of classes. As far as classes go...basically, the people who made Java built a lot of code so Strings could be easy to use by programmers. (This is also why "String" is capitalized: the name of the class has a capital S.) Sorry if this is too technical...but it should answer your questions. More on reddit.com
🌐 r/explainlikeimfive
5
1
November 21, 2015
[Java] If strings are immutable why can their contents be changed?
It's not changing the contents of the string, it's creating a brand new string to which the string reference s now refers. The old string contents referred to by s are discarded and garbage collected. This would (if it were allowed in Java, which it isn't) change the contents of a string: String s = "a"; s[0] = 'z'; More on reddit.com
🌐 r/learnprogramming
10
32
April 30, 2016
ELI5 "public static void main (String[] args)"
This method is the first method the Java compiler sees in order to start running a program. There is a reason why those keywords are there. Here's why: public public is an accessibility modifier in Java. It means that the method can be accessed by entities outside the scope of the defining class. Since this method needs to be accessed by something outside the class (the compiler) it needs to be public static Having a method static, means that it can be called without needing to make an instance of the class first. The compiler can therefore run the main() method without making an instance of the class it contains it. void Void means that the method doesn't return anything. Since it's the first method run, it doesn't need to return anything to the compiler, and therefore it has been set to void. main The name of the method String[] args This is an array of arguments. These are used when you're running your application on command prompt. I'm sorry this is not ELI5, but I hope this helps More on reddit.com
🌐 r/java
10
1
August 1, 2012
ELI5:Basic java terminology

argument - think of a mathematical function f(x). x is an argument of the function.

method - think of it as a function that may, or may not, use some arguments to work

string - a text basically

array - set of elements in a particular orders, each "slot" in the array has its index (counted from 0 up)

class - theoretical description of some entitie, a definition with attributes and methods.

instance - an object representing class. Eg. you've got a class Cat and your pet named Snowball is an instance of this class. Instances are also known as objects, hence the term"object programming"

public/private - these are characteristics assigned to variables that basically mean that they can be edited freely (public) or only by the class it's defined in (private)

static - a characteristic of a variable/method that pretty much says it's independent from instances of class and you can refer to them by class they belong to, not only by particular instances

void - a characteristic of method that doesn't return anything but just does some operations and maybe changes some values.

More on reddit.com
🌐 r/explainlikeimfive
3
1
March 3, 2015
🌐
ScholarHat
scholarhat.com › home
What is String in Java - Java String Methods & Type (Examples)
In Java, the term "string format" describes setting a template with placeholders that will later be filled in with data. Example: "Hello,%s!" can be formatted as "Hello, Java!" by adding the word "Java".
Published: August 30, 2025
🌐
Programiz
programiz.com › java-programming › string
Java String (With Examples)
In Java, a string is a sequence of characters. For example, "hello" is a string containing a sequence of characters 'h', 'e', 'l', 'l', and 'o'. In this tutorial, we will learn about strings in Java with the help of examples.
🌐
TheServerSide
theserverside.com › definition › Java-string
Java string
... Explore Java string creation, memory storage, comparison, utility methods, and mutable alternatives such as StringBuilder and StringBuffer. ... A Java string is a sequence of characters that exists as an object of the class java.lang.
Published: November 22, 2025
🌐
Oracle
docs.oracle.com › javase › tutorial › java › data › strings.html
Strings (The Java™ Tutorials > Learning the Java Language > Numbers and Strings)
The Java platform provides the String class to create and manipulate strings. The most direct way to create a string is to write: ... In this case, "Hello world!" is a string literal—a series of characters in your code that is enclosed in double quotes. Whenever it encounters a string literal in your code, the compiler creates a String object with its value—in this case, Hello world!.
🌐
DZone
dzone.com › coding › languages › java string: a complete guide with examples
Java String: A Complete Guide With Examples - DZone
August 17, 2023 - In Java, the String class is an essential component for handling text-based data. Its immutability ensures thread safety and consistency in applications. Understanding the various methods provided by the String class, as well as when to use StringBuilder or StringBuffer for more intensive manipulations, will enable you to efficiently work with text data in Java programs.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › String.html
String (Java Platform SE 8 ) - Oracle Help Center
July 21, 2026 - 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 string with all characters translated to uppercase or to lowercase. Case mapping is based on the Unicode Standard version specified by the Character class. The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings.
Find elsewhere
🌐
Edureka
edureka.co › blog › java-string
Java Strings - How to Declare String in Java With Examples
February 13, 2025 - I've spent over a decade exploring the fascinating world of... ... In Java, a string is an object that represents a sequence of characters or char values. The java.lang.String class is used to create a Java string object.
🌐
Scaler
scaler.com › home › topics › java › strings in java
String in Java (With Examples) - Scaler Topics
June 21, 2022 - A literal, in computer science, is a notation used for representing a value. Java String literal can be created and represented using the double-quotes. All of the content/characters can be added in between the double quotes. ... In the above-given example, we have declared a string variable called scalerAcad and initialized it with the string value "Scaler Academy".
🌐
Medium
medium.com › geekculture › all-about-string-in-java-51ba9e46181a
All About String in Java. Java Strings are objects that are… | by sajith dilshan | Geek Culture | Medium
February 8, 2023 - Java Strings are objects that are backed by a char array and are immutable. The class java.lang.String is used to create a string object. ... A string literal is created by using double quotes. For example:
🌐
Great Learning
mygreatlearning.com › blog › it/software development › string methods java: a guide to java strings with examples
String Methods Java: A Guide To Java Strings With Examples
October 24, 2024 - A string is a sequence of characters. In Java Programming, strings are widely used and treated as objects, and string in Java can not be changed once it has been created. There are several methods in Java that assist in performing operations ...
🌐
Javatpoint
javatpoint.com › java-string
What is String - javatpoint
Java String class with methods such as concat, compareTo, split, join, replace, trim, length, intern, equals, comparison, substring operation.
🌐
FITA Academy
fita.in › string-functions-in-java
Java Strings: String Functions In Java With Example Program | FITA Academy
Prashanth - String in java is present at ... hence it is an object. There are two ways to create a string in java · With string literal A string can be created by enclosing the characters in double-quotes which creates only one object as follows: ... With new keyword A string can be created by prefixing the string with new keywords. This will create two objects, in the string pool and in the heap memory. Let me show you an example... I joined in FITA to pursue Expertise in Digital Marketing. The training they had given to me is wonderful and they taught more tools and working knowledge in digital marketin
Rating: 5 ​
Address: Plot No 7, 2nd floor, Vadivelan Nagar, Velachery Main Road, Velachery, 600042, Chennai
🌐
DataCamp
datacamp.com › doc › java › java-strings
Java Strings
Strings in Java are immutable, meaning that once a String object is created, its value cannot be changed. Strings can be created in Java using string literals or by instantiating the String class. ... Java provides a robust set of methods to perform various operations on strings. Here are some commonly used methods: public class StringLengthExample { public static void main(String[] args) { String text = "Hello, World!"; int length = text.length(); System.out.println("Length of the string: " + length); } }
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › java-strings
Java – String Class and Methods with examples
String is a sequence of characters, for e.g. “Hello” is a string of 5 characters. In java, string is an immutable object which means it is constant and can cannot be changed once it is created. In this tutorial we will learn about String class and String methods with examples.
🌐
Medium
medium.com › @AlexanderObregon › a-beginners-guide-to-java-strings-3485cba0b517
Java Strings Guide For Beginners | Medium
February 23, 2024 - At the heart of Java’s text ... examples to illustrate their use. A string in Java is fundamentally an object that represents a sequence of characters....
🌐
Medium
medium.com › @smita.s.kothari › all-about-strings-in-java-a-comprehensive-guide-with-examples-9c9a59724392
All About Strings in Java: A Comprehensive Guide with Examples | by Smita Kothari | Medium
April 7, 2025 - In Java, a String is an object that represents a sequence of characters. Unlike primitive data types, strings are handled as objects of the String class in Java.
🌐
Codecademy
codecademy.com › docs › java › strings
Java | Strings | Codecademy
June 10, 2025 - Strings in Java are objects that can hold a sequence of characters contained within a pair of double quotes (""). Strings are immutable, meaning once a string is created, it cannot be changed.
🌐
W3Schools
w3schools.com › java › java_ref_string.asp
Java String Reference
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... The String class has a set of built-in methods that you can use on strings. ... Coding fundamentals as a game. Bite-sized lessons and challenges. ... Ready to start your journey? Your streak is waiting.