when i try to use undefined object ,i get compiler error but there is no option regarding compiler error.

Recommended Answers

The value depends on the object. Intrinsic types have a default built into the type. Custom types can be set within the code.

Jump to Post

All 2 Replies

The value depends on the object. Intrinsic types have a default built into the type. Custom types can be set within the code.

The answer they're probably looking for is null, but the question is ambiguous because it greatly depends on what type is being used, where it's defined, and whether the compiler will even let you compile without assigning a default value explicitly. For example, int isn't a nullable type by default, so how could the "undefined" value be null?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.