Calling String Methods And String Formatting in Java || Tutorials #33

Опубликовано: 18 Август 2026
на канале: KOBCI AQOONTAADA
36
4

Concept: The String class allows you to create objects for holding strings. It also has various methods that allow you to work with strings.
A string is a sequence of characters. It can be used to represent any type of data that contains text, such as names, addresses, warning messages, and so forth. String literals are enclosed in double- quotation marks, such as the following:
"Hello World" "KOBCI AQOONTAADA"
Although programs commonly encounter strings and must perform a variety of tasks with them, Java does not have a primitive data type for storing them in memory. Instead, the Java API provides a class for handling strings. You use this class to create objects that are capable of storing strings and performing operations on them.

The String class
The class that is provided by the Java API for handling strings is named String. The first step in using the String class is to declare a variable of the String class data type. Here is an example of a String variable declaration:
String name;
A class type variable does not hold the actual data item that it is associated with, but holds the memory address of the data item it is associated with. If name is a String class variable, then name can hold the memory address of a String object.