char
is one character. String
is zero or more characters.
char
is a primitive type. String
is a class.
char c="a";
String s = "Hi!";
Note the single quotes for char
, and double quotes for String
.
More Related Contents:
- incompatible types required char found java.lang.string
- Can I product of charAt in Java? [duplicate]
- How to replace a char with a string
- String index out of range in jva
- Why is char[] preferred over String for passwords?
- Check string for palindrome
- How to convert a char to a String?
- How to convert a char array back to a string?
- How can non-ASCII characters be removed from a string?
- Putting char into a java string for each N characters
- Fastest way to iterate over all the chars in a String
- Isn’t the size of character in Java 2 bytes?
- How to convert/parse from String to char in java?
- The concatenation of chars to form a string gives different results
- In Java, how to find if first character in a string is upper case without regex
- How do I check if a char is a vowel?
- How do I apply the for-each loop to every character in a String?
- Illegal Escape Character “\”
- Reading String for list of Integers separated by spaces [duplicate]
- String.equals versus == [duplicate]
- Converting A String To Hexadecimal In Java
- Java String replace not working [duplicate]
- What’s the best way to build a string of delimited items in Java?
- How to split a string between letters and digits (or between digits and letters)?
- How to obtain the last path segment of a URI
- How to get data from each dynamically created EditText in Android?
- Garbage collection behaviour for String.intern()
- Why does String.hashCode() in Java have many conflicts? [closed]
- Use string in switch case in java
- what is Ljava.lang.String;@