Home »
MCQs »
Scala MCQs
The semicolon (;) in Scala is –
6. The semicolon (;) in Scala is -
- Necessary, failing to write will not mark the end of line
- Not required, it is treated as a character
- Optional, end of the line does not require ;
- None of these
Answer: C) Optional, end of the line does not require ;
Explanation:
If the programmer puts a semicolon at the end of the line it's ok and if no semicolon is present even then too the compiler does not throw any error. Read more: Semicolons in Scala