Computer Science, asked by anshu12310, 1 year ago

what is a block in Java?

Answers

Answered by jammu77
2
A block statement is a sequence of zero or more statements enclosed in braces. A block statement is generally used to group together several statements, so they can be used in a situation that requires you to use a single statement. In some situations, you can use only one statement. If you want to use more than one statement in those situations, you can create a block statement by placing all your statements inside braces, which would be treated as a single statement. You can think of a block statement as a compound statement that is treated as one statement.

I hope it's help u ✌✌✌✴
Answered by Dickens
9
Here is your answer:-
A block in Java is a group of one or more statements enclosed in braces. Ablock begins with an opening brace ({) and ends with a closing brace (}). Between the opening and closing braces, you can code one or more statements. For example: { int i, j; i = 100; j = 200; } A block is itself a type of statement.

Mark as brainliest.
Similar questions