#9 What is String in Java

Veröffentlicht am: 18 Juni 2023
auf dem Kanal: Nilesh Kavankar
87
1

In this video, I have explained What is a string variable in Java & it's methods.

Definition:
String is a variable contains a collection of characters/text surrounded by double quote.
For example String s = “JavaSession”;

In Java, String is basically an object which provides a lot of methods that can perform specific operations on strings such as
compare(), concat(), equals(), split(), length(), toUpperCase(), toLowerCase() etc.

String Concatenation:
In Java, String concatenation forms a new String that is the combination of multiple strings. There are two ways to concatenate strings in Java:
i. By + operator
ii. By concat() method

Note: Java uses the + operator for both addition and concatenation.
Always remember: Numbers are added. Strings are concatenated
If you add two numbers, the result will be a number
If you add two strings, the result will be a string concatenation
If you add a number and a string, the result will be a string concatenation:


Auf dieser Seite können Sie das Online-Video #9 What is String in Java mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Nilesh Kavankar 18 Juni 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 87 Mal angesehen und es wurde von 1 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!