+ 2
can we store a variable with the value like "Jaipur298". Is it possible or not and why?
please help me out.
1 Respuesta
+ 9
Yes it is possible to store "Jaipur298" with a variable using the String .
Syntax of declaration will be :
String variable = "Jaipur298";
Note that String begins with capital S . Using 'string' will result in error . Also don't forget the double quotes .
For many characters and numbers together we use the String . We store numbers in int/double/float , etc. and only one special character ,letter ,digit in character(char) datatype. So you can say String is a collection of many characters .