Which XXX and YYY correctly output the smallest values? Array userVals contains 100 elements that are integers (which may be positive or negative). Choices are in the form XXX / YYY.
Given two arrays, studentNames that maintains a list of student names, and studentScores that has a list of the scores for each student, which XXX and YYY prints out only the student names whose score is above 80? Choices are in the form XXX / YYY.
Which if branch executes when an account lacks funds and has not been used recently? hasFunds and recentlyUsed are booleans and have their intuitive meanings.
What is not a key advantage of using an enum as below have versus using a string for myCar and string literals like "red", "green", and "black"?
public enum CarColor {RED, GREEN, BLACK} CarColor myCar; myCar = CarColor.GREEN; if (myCar == CarColor.GREEN) { System.out.print("Green is our most popular color"); }
The possible colors are made explicit
The compiler will yield an error for a misspelled color like GREN
Capital letters can be used to make the colors clearer
The compiler will yield an error for an unsupported color like BLUE
Capital letters can be used to make the colors clearer
The world population is over 7 billion. Which declaration uses the fewest bits while guaranteeing that worldPopulation can be assigned the value 7 billion without error?