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:
Sur cette page du site, vous pouvez voir la vidéo en ligne #9 What is String in Java durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Nilesh Kavankar 18 juin 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 87 fois et il a aimé 1 téléspectateurs. Bon visionnage!