Computer Science, asked by Bhanupartap9420, 1 year ago

Which statements correctly declare boolean variables? a boolean isvalid = true; b boolean isvalid = true; c boolean isvalid = new boolean (true); d boolean isvalid = 1;?

Answers

Answered by minecrafted1357
2

this is for c#

a and b are the same?

bool is a shortcut for Boolean in c#

bool isValid = true; is correct

bool isValid = new bool(true); is not valid in c#

bool isValid = 1; is not valid in c# but you can cheese it by using

bool isValid = Convert.ToBoolean(1);

Similar questions