Multiple choice technology programming languages

How is an empty XML element defined?

  1. <sample></sample>

  2. <sample/>

  3. None of the above

  4. Option 1 & 2

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

XML allows two equivalent syntaxes for empty elements: a full open/close tag pair with no content, or a self-closing shorthand. Both are valid and interchangeable.