Explain the usage of the following special symbol in Java: ,(comma)
Advertisements
Question
Explain the usage of the following special symbol in Java:
,(comma)
Explain
Advertisements
Solution
The comma (,) is used in Java to separate multiple variables in a declaration and to separate arguments in a method call. It helps distinguish different items written within the same statement.
Example:
int a = 10, b = 20, c = 30;
shaalaa.com
Is there an error in this question or solution?
