Computer Science, asked by vishmish34, 10 months ago

Distinguish between “A” and ‘A’ in java

Answers

Answered by gshanahmad8
8

Originally Answered: What is difference between 'a' and "a" in Java? In Java, To represent single char-value, we use single-quotes like 'a' whereas to represent String value/object, we use double-quotes like “a”

Answered by qwcricket10
4

The main difference is that 'A' represents a character and "A" denotes a string.

  • Java is used to develop a program based on the class, object-oriented concept.
  • Many advantages make the Java program very popular.
  • In java when a variable is enclosed within a single quote it means that the variable can store a character.
  • When using double quotes it can store a string value of any length.
  • Here, 'A' is a character and "A" is a string.
Similar questions