how to include .inc files in drupal8 in custom form I have my custom module in drupal8.I have created a custom form.My form has many fields so i was wanted to move it to .inc files.Please can someone suggest me how and where to include my .inc file.
The procedural function for include files seems still to exists module_load_include(), but you shouldn't use it in a form class. Normally you would refactor the code inside of the form class in multiple class methods. If you want an extra file, then create a new class and include it in your form class with an use statement. Each class has it's own file, which is autoloaded with PSR-4, see https://www.drupal.org/docs/develop/coding-standards/psr-4-namespaces-and-autoloading-in-drupal-8

A Trait is an alternative option. You would put the refactored methods in an extra Trait file, but logical the methods remain class methods and at the same time are reusable by other classes. The Traits are also autoloaded. See https://drupalize.me/blog/201503/dependency-injection-traits-drupal-8