 An exception will be thrown if invalid.Anonymous types are nameless classes that are generated by the compiler.They are only consumable and yet very useful in a scenario like where you have a LINQ query which returns an object on and you just want to return some specific values.