What is the error message that you would get if you try to
assign "Null" to an integer variable?

Answer Posted / govind. konduri

hai...

when we will try to assign a null value to integer as
shown below.

int a=null;//error
console.WriteLine(a);

when compile the above code it will show the error message.

"cannot convert null to int because it is a non-nullable
value type"


so...if we want to assign 'null' to 'int' .we have to write
like this..
int? a=null;//valid

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the different Types of Recordsets.

1840


Explain about arrays?

814


Why do I get "object not an array" when I try reference the fields of a global object variable which I have set to a table?

1370


what are the Parts of ODBC?

1598


Draw Sequence Modal of DAO? Explain.

1941


How would you add elements in TreevieW Control?

1736


What is the need of tabindex property is label control.

1668


State about the different types of visual basic data?

756


What are the different procedures associated with the object?

800


What is OLEDB?

2103


Where can I get good up-to-date information about VB?

1100


Types of ActiveX Components in VB?

1635


___ property used to add a menus at runtime.

1486


How would you add column headers in listview control?

1856


How do I call a DLL?

1246