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

I'm getting error message "Reserved Error [-nnnn] ("There is no message for this error")" from Jet Engine 2.0.Why?

1075


How many tabs in a tabbed dialog do you consider appropriate?

1698


How can you Add API functions to your Application?

1359


How can I speed up my VB database application?

973


What is the use of Data Form Wizard?

1498






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

1447


How would you add column headers in listview control?

1657


What is Parser Bug?

1880


What is a thread pool and how are the threads within a thread pool managed?

1609


What is the current version of Visual Basic for Windows?

1121


How do I create controls dynamically (at run-time)?

962


DHTML Is used for what?

1470


How do you change the system menu (on the Control-Menu Box)?

975


What is the use of debug Window?

1551


How would you Create a Query Builder and Explain its uses ?

1622