2.1.b - Relational Expressions
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What does the operator != do?
💡 Hint: Think about the opposite of equality.
What value does x > y return when x is 5 and y is 3?
💡 Hint: Is 5 greater than 3?
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does the == operator do?
💡 Hint: Think of it as asking if the two values are the same.
True or False: The expression x <= y checks if x is greater than y.
💡 Hint: Consider what the symbol `<=` means.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
Write a program that compares two user inputted numbers and prints the largest using relational expressions.
💡 Hint: Think about how you'd compare two values and what you want to print.
Define a Java method that takes three integers as parameters and returns the smallest number using relational expressions.
💡 Hint: Consider how you could start with one variable and compare it with the others.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.