A block is written in two ways:
Multi-line between do and end
Inline between braces {}
Both are same and have the same functionality.
For more information: Click here
syntax:block_name{ statement1 statement2 .......... }
syntax:
block_name{
statement1
statement2
..........
}