What is string in java?
Strings are easily defined by enclosing a series of characters between double quotes. Strings may be of any length, but they cannot include a line break. Java strings are not null-terminated.
To include a double quote within a string, precede the double quote by a backslash character. In this context, the backslash prevents the compiler from treating the double quote as a termination for the string.
To declare and initialize a variable of type string refer below example.
String s = "This is my string variable.";
After execution of this statement string variable having name 's' contains the string "This is my string variable.". It can be used anywhere where you can use a string.
What is character in java?
Java characters are 16 bit unicode characters. Unicode is a character set that can accommodate many different human languages. This enables developers to write java applications that can work for international audiences.
A character literal is enclosed by single quotes. For example,
char c = 'V';