+ 2

What is difference between char var and String var

please answer over marrow is my exam

4th Mar 2017, 5:14 PM
Anyon2748
Anyon2748 - avatar
2 Answers
+ 3
char variables can be assigned single character, example: char variable ='a'; char variable ='5'; while String variables can be assigned one or more than one characters. Example : String var = "a"; String var = "Hi fellas";
4th Mar 2017, 7:17 PM
Swastika Srivastava
Swastika Srivastava - avatar
+ 6
char is a primitive type String is an object type
4th Mar 2017, 5:21 PM
Alexey
Alexey - avatar