Multiple choice technology web technology

Which attribute would you use to make the class variable being Non-serializable

  1. Serialized

  2. OptionalAttribute

  3. NonSerializable

  4. Deserialized

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The [NonSerialized] attribute in .NET prevents a specific field from being serialized during the serialization process. This is useful for fields that contain runtime-only data, sensitive information, or data that should not persist between sessions. The other options are not valid attributes for preventing serialization.