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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started