Consider the following two Java code segments:

```
Segment 1 Segment 2
int i = 0;
for (int i = 0; i <= 20; i++)
while (i < 20) {
{ System.out.println(i);
i++; }
System.out.println(i);
}
```

Which of the following statements are true?
a. The output from these segments is not the same.
b. The scope of the control variable i is different for the two segments.
c. Both (a) and (b) are true.
d. Neither (a) nor (b) is true.

d. Neither (a) nor (b) is true.

Computer Science & Information Technology

You might also like to view...

In Excel, you can not only track and manage financial and numerical data, but you can also create simple databases

Indicate whether the statement is true or false

Computer Science & Information Technology

Given the following code: template < class ItemType> ArrayStack::ArrayStack() : top(-1) { } What method is this?

a. the default destructor b. the virtual destructor c. the default constructor d. the copy constructor

Computer Science & Information Technology