Difference between Braces, Brackets and Parenthesis
The basic difference between Braces, Brackets and Parentheses with respect to programming (In C programming) .
{ }
|
Braces
("curly braces")
Braces are used to group statements and declarations.
The contents of a class or interface are enclosed in braces. Method bodies and constructor bodies are enclosed in braces. Braces are used to group the statements in an if statement, a loop, or other control structures. |
[ ]
|
Brackets
("square brackets")
Brackets are used to index into an array.
|
( )
|
Parenthesis
Parentheses are used for two purposes: (1)
to control the order of operations in an expression, and (2) to supply
parameters to a constructor or method.
|
Comments
Post a Comment