Šī pārlūkprogramma vairs netiek atbalstīta.
Jauniniet uz Microsoft Edge, lai izmantotu jaunāko līdzekļu, drošības atjauninājumu un tehniskā atbalsta sniegtās priekšrocības.
When is it appropriate to use a switch-case construct rather than a if-elseif-else construct?
switch-case
if-elseif-else
A switch-case construct is appropriate when more than 2-3 else if code blocks are required.
else if
A switch-case construct is appropriate when the number of case patterns is small.
case
A switch-case construct is appropriate when the selection statement is inside a loop.
Why should a developer choose a for statement rather than a foreach statement when processing the contents of a multidimensional array?
for
foreach
for statements do a better job of examining each array item separately.
foreach statements do a better job of examining each array item separately.
for statements enable a developer to treat array dimensions separately.
Why is it important to scope a variable at its lowest necessary level?
It ensures that a variable that's declared outside of a code block, can be accessed inside the code block before it's been assigned a value.
It ensures that application resources and the security footprint are kept small.
It ensures that a variable can be accessed within the lowest level code branches of an application.
You must answer all questions before checking your work.
Vai šī lapa palīdzēja?
Vai nepieciešama palīdzība saistībā ar šo tēmu?
Vai vēlaties izmēģināt lietotni Ask Learn, lai noskaidrotu vai palīdzētu jums apgūt šo tēmu?