English

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?
Chapter 6: Variables and Expressions - EXERCISE [Page 135]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
EXERCISE | Q 60. (a) | Page 135
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×