---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/concepts/java-reference_catboostmodel__gettreecount.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# getTreeCount

```java
public int getTreeCount()
```

#### Purpose

<!-- source: en/_includes/work_src/reusage-java/java__get-tree-count__desc.md -->
Return the number of trees in the model.
<!-- endsource: en/_includes/work_src/reusage-java/java__get-tree-count__desc.md -->

