C# program to check a specified class is a serializable class or not
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to check a specified class is a serializable class or not is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created two classes Sample and Program. The Sample is a serializable class that contains a static Method Print(), and the Program class contains the Main() method. The Main() method is the entry point for the program. Here, we check the specified class is a serializable class or not using the IsSerializable property of Type class and printed the appropriate message on the console screen.