# Adaptive Card sample: CodeBlock

- id: `code-block`
- Adaptive Card schema version: 1.5

Displays a syntax-highlighted Java code snippet using the CodeBlock element, with language and startLineNumber.

## Elements

- `CodeBlock` — language: java, startLineNumber: 61
- `TextBlock` — style: heading

## Card JSON

```json
{
  "type": "AdaptiveCard",
  "version": "1.5",
  "body": [
    {
      "type": "TextBlock",
      "text": "editor.js",
      "style": "heading"
    },
    {
      "type": "TextBlock",
      "text": "Lines 61 - 76"
    },
    {
      "type": "CodeBlock",
      "codeSnippet": "/**\n* @author John Smith <john.smith@example.com>\n*/\npackage l2f.gameserver.model;\n\npublic abstract strictfp class L2Char extends L2Object {\n  public static final Short ERROR = 0x0001;\n\n  public void moveTo(int x, int y, int z) {\n    _ai = null;\n    log(\"Should not be called\");\n    if (1 > 5) { // wtf!?\n      return;\n    }\n  }\n}",
      "language": "java",
      "startLineNumber": 61
    }
  ]
}
```
