When you catch an exception, what method can you use to get the type of the exception?
Category: Uncategorized
To change the name of all occurrences of a variable name aft…
To change the name of all occurrences of a variable name after you change the first occurrence, you can use
Code example 7-1private void btnCalculate_Click(object sende…
Code example 7-1private void btnCalculate_Click(object sender, System.EventArgs e){ decimal weightInPounds = 0m; try { weightInPounds = Convert.ToDecimal(txtPounds.Text); if (weightInPounds > 0) { decimal weightInKilos = weightInPounds / 2.2m; lblKilos.Text = weightInKilos.ToString(“f2”); } else { MessageBox.Show(“Weight must be greater than 0.”, “Entry error”); txtPounds.Focus(); } } catch(FormatException) { MessageBox.Show(“Weight must be numeric.”, “Entry error”); txtPounds.Focus(); }} (Refer to code example 7-1.) If the user enters “200#” in the text box and clicks the Calculate button, what does the code do?
When can you not code a method using an expression body?
When can you not code a method using an expression body?
What statement is used to implement the selection structure?
What statement is used to implement the selection structure?
To refer to the second column in the fourth row of a rectang…
To refer to the second column in the fourth row of a rectangular array named vendors, you code
An OverflowException can be avoided by a type of data valida…
An OverflowException can be avoided by a type of data validation known as
When you call a method, the arguments you pass to it
When you call a method, the arguments you pass to it
Which of the following statements declares a typed List coll…
Which of the following statements declares a typed List collection named dueDays that will hold int values?
Which of the following is not true for typed collections?
Which of the following is not true for typed collections?