✏️ Explanatory Question

Can the curly brackets { } be used to enclose a single line of code?

👁 3,884 Views
📘 Detailed Answer
💡

Answer with Explanation

While curly brackets are mainly used to group several lines of codes, it will still work without error if you used it for a single line. Some programmers prefer this method as a way of organizing codes to make it look clearer, especially in conditional statements.