Please enable JavaScript to use CodeHS

Texas Computer Science 2

Lesson 4.9 Comparison Operators

Description

In this lesson, students will explore comparison operators in Java, which are essential for making decisions within a program. By learning how to compare variables using operators such as ==, !=, >, <, >=, and <=, students will gain the ability to evaluate expressions and control the flow of their programs based on conditions. Through a series of examples and hands-on exercises, students will understand how comparison operators are used in real-world scenarios, such as grading systems, and apply these concepts to their own programming projects.


Objective

Students will be able to:

  • Define and use comparison operators in Java
  • Write conditional statements that evaluate expressions using comparison operators
  • Apply comparison operators to solve real-world problems and scenarios