Given the code fragment:
public static void main(String[] args) {
String [] table = {"aa", "bb", "cc"};
int ii = 0;
for (String ss:table) {
while (ii < table.length) {
System.out.println (ii);
ii++;
break;
}
}
How many times is 2 printed?
A.
zero
B.
once
C.
twice
D.
thrice
E.
it is not printed because compilation fails
Explanation:
The outer loop will run three times, one time each for the elements in table.
The break statement breaks the inner loop immediately each time.
2 will be printed once only.
Note: If the line int ii = 0; is missing the program would not compile.
Although sites we backlink to below are considerably not connected to ours, we really feel they are truly worth a go by, so have a look.
here are some links to internet sites that we link to since we believe they’re worth visiting
the time to study or go to the content material or web-sites we have linked to below the
although internet websites we backlink to below are considerably not connected to ours, we feel they may be in fact really worth a go through, so possess a look
just beneath, are many completely not associated web sites to ours, however, they’re surely really worth going over
we like to honor several other online web sites on the web, even if they arent linked to us, by linking to them. Under are some webpages worth checking out
Here are a few of the internet sites we advise for our visitors
please check out the web-sites we stick to, which includes this a single, as it represents our picks in the web
very few web sites that come about to become comprehensive below, from our point of view are undoubtedly very well really worth checking out
although websites we backlink to beneath are considerably not associated to ours, we really feel they may be truly really worth a go as a result of, so possess a look
Wonderful story, reckoned we could combine a few unrelated data, nevertheless truly really worth taking a appear, whoa did 1 master about Mid East has got much more problerms at the same time
check below, are some absolutely unrelated web-sites to ours, even so, they are most trustworthy sources that we use
one of our visitors recently encouraged the following website
????
very few internet sites that transpire to become comprehensive below, from our point of view are undoubtedly well worth checking out
here are some hyperlinks to sites that we link to simply because we consider they are worth visiting