

# Using Amazon Q Developer for block completion
<a name="code-block"></a>

Block completion is used to complete your `if/for/while/try` code blocks.

------
#### [ C ]

![\[An example of the block completion feature using C\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/block-completion-c.gif)


------
#### [ C\$1\$1 ]

![\[An example of the block completion feature using C++.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/block-completion-c-plus.gif)


------
#### [ Java ]

In the example below, a user enters the signature of an `if` statement. The body of the statement is a suggestion from Amazon Q.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-block-completion.gif)


------
#### [ C\$1 ]

In the image below, Amazon Q recommends a way to complete the function.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/c-sharp-block.gif)


------
#### [ TypeScript ]

In the image below, Amazon Q recommends a way to complete the function.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/typescript_vscode_block-completion.gif)


------
#### [ Python ]

In this example, Amazon Q recommends a block of code, based on the context. 

![\[An example of the code block feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_codeblock.gif)


------