Do you know that APEX doesn’t support some features? These features are:
It cannot show the elements in UI other than an error message.
It cannot change the standard SFDC functionality but can be used to stop its execution or to add new functionality.
It cannot be used to create a temporary file.
It cannot create multiple threads.
In this Video Shrey has explained that why these above-mentioned features are not supported by APEX.