Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the purpose of an 'if' statement?
Think about the structure: 'if (condition) { code }'
Name one type of looping statement.
Consider how you would repeat actions in code.
Which statement correctly checks if a number is negative?
Think about the properties of negative numbers.
True or False: A 'for' loop can run indefinitely.
Consider how the for loop is constructed.
Write a Java program using both 'if' and 'switch' statements to determine the day of the week based on an integer (1-7) and print the corresponding day.
Remember to use 'case' statements for different day options.
Create a program that counts from 1 to 10 but skips even numbers using a 'continue' statement within a loop.
Think about the condition that identifies even numbers.
5 more questions in this section. Enroll free to practise them all.
Enroll free