What is the purpose of the 'using' statement in C#?

  1. Automatic resource disposal and namespace imports
  2. Defining classes
  3. Only for importing namespaces
  4. Creating variables

Explanation

The 'using' statement serves two purposes: importing namespaces and ensuring automatic disposal of resources that implement IDisposable, providing proper resource management.