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:
In questa pagina del sito puoi guardare il video online #9 What is String in Java della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Nilesh Kavankar 18 giugno 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 87 volte e gli è piaciuto 1 spettatori. Buona visione!