Consider the classes below:

public class TestA
{
public static void main(String args[])
{
int x = 2;
int y = 20
int counter = 0;

for (int j = y % x; j < 100; j += (y / x))
counter++;
}
}

public class TestB
{
public static void main(String args[])
{
int counter = 0;

for (int j = 10; j > 0; --j)
++counter;
}
}

Which of the following statements is true?
a. The value of counter will be different at the end of each for loop for each class.
b. The value of j will be the same for each loop for all iterations
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...

You are given two sets of 100 points that fall within the unit square. One set of points is arranged so that the points are uniformly spaced. The other set of points is generated from a uniform distribution over the unit square.

(a) Is there a difference between the two sets of points? (b) If so, which set of points will typically have a smaller SSE for K=10 clusters? (b) If so, which set of points will typically have a smaller SSE for K=10 clusters?

Computer Science & Information Technology

Undeleting or restoring a file must be done within the Recycle Bin

Indicate whether the statement is true or false

Computer Science & Information Technology

There are two ways to program the IPv6 interface address. True or false?

a. True b. False

Computer Science & Information Technology

Which of the following types of encryption will help in protecting files on a PED?

A. Mobile device encryption B. Transport layer encryption C. Encrypted hidden container D. Database encryption

Computer Science & Information Technology