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

How can you check whether a record is valid record or Invalid record using ADO control or Object?

1452


How to customize workgroup message?

615


What are the types of line styles available in Treeview Control?

1465


Difference between Tabletype and Snapshot?

1490


What is the-use of property page Wizard in ActiveX Control?

1551






Types of LockEdits in DAO? 51 .Types of Recordsets.

1371


Can any one please suggest which institute is providing Advance Excel & VBA Macros in Excel training in Hyderabad.

1746


What are 3 main differences between flexgrid control and dbgrid control?

1882


In which areas the Error occurs?

1475


What is the use of Hyperlink control for DHTML applications?

1425


what are the Types of LockEdits in RDO?

1558


What are the types of API Types.

1696


What language does visual basic use?

516


Is there any way to pass a variable to a form apart from using global variables?

1093


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?

1161