300-435 · Question #70
YANG modeling supports which two comment styles? (Choose two.)
The correct answer is D. A block comment is enclosed within"/*" and"*/". E. A single-line comment starts with "//"and ends at the end of the line. YANG modeling supports single-line comments starting with // and block comments enclosed within / and /.
Question
Exhibit
Options
- AA block comment is enclosed within"<--" and"-->".
- BA single-line comment starts with "#"and ends at the end of the line.
- CA single-line comment starts with "/"and ends at the end of the line.
- DA block comment is enclosed within"/" and"/".
- EA single-line comment starts with "//"and ends at the end of the line.
How the community answered
(33 responses)- B3% (1)
- C6% (2)
- D91% (30)
Why each option
YANG modeling supports single-line comments starting with `//` and block comments enclosed within `/*` and `*/`.
The comment style `<-- -->` is typically used in XML, not YANG.
The `#` character is used for comments in many scripting languages and configuration files, but not for single-line comments in YANG.
A single forward slash `/` does not signify a comment in YANG; it requires two forward slashes `//` for single-line comments.
In YANG, a block comment is correctly defined as being enclosed within `/*` and `*/`, allowing for multi-line comments within the model definition.
YANG utilizes `//` to denote a single-line comment, with all text following these characters until the end of the line being treated as a comment.
Concept tested: YANG comment syntax
Source: https://datatracker.ietf.org/doc/html/rfc7950#section-6.1.6
Topics
Community Discussion
No community discussion yet for this question.
