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.
Correct Answer:
Verified
Q2: Which of the following statements about the
Q3: For the two code segments below:
Segment A
Int
Q6: Which of the following statements about the
Q8: Consider the code segment below.
If (gender ==
Q9: Which of the following can be used
Q9: For the code segment below:
Switch(q)
{
Case 1:
System.out.println("apple");
Break;
Case 2:
System.out.println("orange");
Break;
Case
Q12: Which of the following will count down
Q12: Which of the following is equivalent to
Q14: Which of the following for-loop headers results
Q19: Which statement prints the floating-point value 123.456
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents