---
Product: Aspose.Slides
Platform: java
Page Type: reference
Canonical URL: https://reference.aspose.org/slides/java/size
---

# Size

## Overview

`Size` is a class in Aspose.Slides FOSS for Java.

Represents a 2D size with integer dimensions.

This class declares 12 methods for Size objects in Java programs.
Available methods include: `Size`, `add`, `equals`, `getHeight`, `getWidth`, `hashCode`, `isEmpty`, `setHeight`, `setWidth`, `subtract`, `toString`.
Public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package.
Properties: `EMPTY`, `empty`, `height`, `width`.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `width` | `int` | Read/Write | Gets the width. |
| `height` | `int` | Read/Write | Gets the height. |
| `empty` | `boolean` | Read | Returns {@code true} if both dimensions are zero. |
| `EMPTY` | `Size` | Read | Empty size with dimensions (0, 0). |

## Methods

| Signature | Description |
|-----------|-------------|
| `Size(width: int, height: int)` | Initializes a new instance of Size with the specified dimensions. |
| `Size()` | Initializes a new instance of Size with dimensions (0, 0). |
| `getWidth()` → `int` | Gets the width. |
| `setWidth(width: int)` | Sets the width. |
| `getHeight()` → `int` | Gets the height. |
| `setHeight(height: int)` | Sets the height. |
| `isEmpty()` → `boolean` | Returns {@code true} if both dimensions are zero. |
| `add(a: Size, b: Size)` → `Size` | Adds two sizes component-wise. |
| `subtract(a: Size, b: Size)` → `Size` | Subtracts one size from another component-wise. |
| `equals(obj: Object)` → `boolean` | Checks whether the given object is a Size with equal dimensions |
| `hashCode()` → `int` | Computes a hash code based on width and height |
| `toString()` → `String` | Calls toString on this Size instance. |

## See Also

- [Aspose.Slides — Enterprise API Reference](https://reference.aspose.com/slides/)