Question 171

Given:
public class ScopeTest {
int j, int k;
public static void main(String[] args) {
ew ScopeTest().doStuff(); }
void doStuff() {
nt x = 5;
oStuff2();
System.out.println("x");
}
void doStuff2() {
nt y = 7;
ystem.out.println("y");
or (int z = 0; z < 5; z++) {
ystem.out.println("z");
ystem.out.println("y");
}
Which two items are fields?
  • Question 172

    Given the code fragment:
    LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14);
    LocalDate nextYear = valentinesDay.plusYears(1);
    nextYear.plusDays(15); //line n1
    System.out.println(nextYear);
    What is the result?
  • Question 173

    What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?
  • Question 174


    What is the result?
  • Question 175

    Given the code fragments:

    and

    What is the result?