Question: Which for the loop prints the odd numbers from 1 to 99? a) for(int n = 1;n
Which for the loop prints the odd numbers from 1 to 99?
a) for(int n = 1;n <= 99; i++){
System.Out.println(n);
}
b) for(int n = 1;n <= 99; i += 2){
System.Out.println(n);
}
c) for(int n = 1;n <= 99; i *= 2){
System.Out.println(n);
}
d) for(n <= 99; int n <= 1; i -= 2){
System.Out.println(n);
}
2. Which statement is needed to use a Scanner object?
import java.util;
import java.lang;
import java.util.Scanner;
import.java.lang.Scanner;
3. In a method definition, which annotation is used to indicate that the method overrides the method with the same name in the base class.
@Override
@Overrides
@Replace
@Replaces
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
