try: Handler[] mouse_handlers = new [WM_MOUSELAST - WM_MOUSEFIRST + 1] or if the size is statically known: Handler[WM_MOUSELAST - WM_MOUSEFIRST + 1] handler;