GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

words is an ArrayList that holds exactly 4 elements. Which c…

words is an ArrayList that holds exactly 4 elements. Which call throws an IndexOutOfBoundsException?

Read Details

What is printed by the following code?int timer = 4; int bee…

What is printed by the following code?int timer = 4; int beeps = 0; while (timer < 1) { beeps++; timer--; } System.out.println(beeps + " " + timer);

Read Details

What happens when this code runs?int[] pts = {3, 5, 7}; int…

What happens when this code runs?int[] pts = {3, 5, 7}; int total = 0; for (int i = 0; i

Read Details

A program needs to check whether the String variable word ho…

A program needs to check whether the String variable word holds exactly the text stop. Why should it use word.equals(“stop”) instead of word == “stop”?

Read Details

Which line of this code causes a compile error?String city =…

Which line of this code causes a compile error?String city = “Lima”; string country = “Peru”; int year = 2026; String label = city + year;

Read Details

What is printed by the following code?String answer = “Yes”;…

What is printed by the following code?String answer = “Yes”; answer.toLowerCase(); System.out.println(answer + ” ” + answer.equals(“yes”));

Read Details

This code is meant to print a single letter grade, but with…

This code is meant to print a single letter grade, but with a score of 95 it prints ABC. Which change makes it print just A?int score = 95; if (score >= 90) { System.out.print(“A”); } if (score >= 80) { System.out.print(“B”); } if (score >= 70) { System.out.print(“C”); }

Read Details

Which of the following is an expression, not a complete stat…

Which of the following is an expression, not a complete statement?

Read Details

What happens when this code runs?String nickname = null; Sys…

What happens when this code runs?String nickname = null; System.out.println(nickname); System.out.println(nickname.length());

Read Details

What is printed by the following code?int miles = 15; int ho…

What is printed by the following code?int miles = 15; int hours = 2; System.out.println(miles / hours * 1.0);

Read Details

Posts pagination

Newer posts 1 … 9 10 11 12 13 … 100,399 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top