c# - What is the difference between Nullable<bool> and bool? -
this question has answer here:
when reverse engineer classes following:
public nullable<bool> correct { get; set; } public nullable<bool> response { get; set; } i coded:
public bool? correct { get; set; } public bool? response { get; set; } can tell me if there difference between these two. have not seen nullable<bool> before , i'm not sure why not create "bool".
note: changed coded bool? in response comments jon
"a nullable can assigned values true false, or null. ability assign null numeric , boolean types useful when dealing databases , other data types contain elements may not assigned value. example, boolean field in database can store values true or false, or may undefined."
Comments
Post a Comment