Java Basics Review Exam Notes

Test Information

  • Description: Review of Java Basics through an online test format.
  • Instructions:
    • The test features a 5-minute time limit.
    • Automatic submission occurs when time expires.
    • Time alerts are provided at specific intervals: 5 minutes, 1 minute, and 30 seconds remaining.
    • Multiple Attempts: Only one attempt is allowed; no retries.
    • Force Completion:
    • The test can be saved and resumed any time until time expires.
    • The timer continues to run upon leaving the test.
    • No backtracking is allowed; answers cannot be changed after submission.
    • Answers are saved automatically.

Questions Overview

Question 1
  • Statement: The following is a valid Java statement: String str = "CSCC";
  • Answer Options: True or False.
Question 2
  • Statement: The following is a valid Java statement: String result = (var >= 0) ? "Yes" : "No"; (where var is declared as type int and initialized).
  • Answer Options: True or False.
Question 3
  • Statement: In an expression without parentheses, multiplication takes precedence over subtraction.
  • Answer Options: True or False.
Question 4
  • Required Before Using Primitive Data Type Variable:
    • The variable must be declared.
    • The variable must be initialized.
    • The variable must not be exported, output, or recursive.
Question 5
  • Statements that Decrement the Int Variable x by One:
    • x--; (decrement by 1)
    • --x; (pre-decrement, also decrements by 1)
    • Incorrect options include:
    • x++; (increments by 1)
    • x = x 1; (this is incorrectly formatted)
    • x = -1; (sets x to -1, does not decrement)

Conclusion

  • Review Java syntax and operator precedence.
  • Ensure understanding of variable declaration and initialization rules in Java.
  • Familiarize yourself with correct usage and decrementing applications by reviewing java programming basics as these concepts are critical for the test.