- There are many scenarios where you need to compare…strings to each other.…And using simple equality operators as you might…do with numbers, doesn't work the way you'd expect.…In this project, CompareStrings, I've declared two…string variables.…They both have the same value, a string of Hello.…I'm going to add a bit of conditional code.…In Java you can write some simple conditional code…with the if statement.…The if statement places a boolean condition inside a…pair of parentheses.…
And I'll compare str1 to str2…using the == operator.…That's called the equality operator…and it works great with primitive numbers, booleans,…and characters.…With strings it might appear that it works also.…If this condition is true, I'll output a string…to the console of They match!…Then I'll add an else clause after the if clause…and in that section I'll output They don't match!…Then I'll run the code.…
Everything seems to match expectations.…The two strings are identical…and I get back They match!…But the reasons for that match aren't…
Author
Updated
9/30/2020Released
7/24/2015- Understanding the history and principles of Java
- Installing Java, IntelliJ IDEA, and BlueJ
- Creating a Java project
- Working with variables, values, and expressions
- Working with object data types
- Building, comparing, and parsing strings
- Debugging and exception handling
- Creating loops and reusable code
- Passing arguments by reference or value
- Using simple and complex arrays
- Creating custom classes
- Understanding inheritance and polymorphism
- Managing files with Java libraries
- Documenting code with Javadoc
- Packaging classes in JAR files
Skill Level Beginner
Duration
Views
Related Courses
-
Java Essential Training for Students
with Peggy Fisher3h 6m Intermediate
-
Introduction
-
Welcome59s
-
Is this course for you?3m 22s
-
Using the exercise files5m 5s
-
-
1. What Is Java?
-
The history of Java5m 57s
-
Java syntax and compilation5m 26s
-
-
2. Installing the Software
-
Installing Java on Windows3m 49s
-
Installing Java on OS X2m 50s
-
Installing BlueJ1m 52s
-
-
3. Getting Started
-
Hello World5m 44s
-
-
4. Working with Variables
-
Converting numeric values5m 37s
-
Using Java operators6m 11s
-
5. Working with Objects
-
Using the String class5m 5s
-
Comparing string values5m 51s
-
Parsing string values3m 13s
-
Working with dates and times8m 35s
-
6. Exception Handling and Debugging
-
Debugging with IntelliJ IDEA5m 18s
-
Throwing custom exceptions3m 19s
-
7. Managing Program Flow
-
Using the switch statement4m 51s
-
Creating looping code blocks5m 23s
-
8. Using Data Collections
-
Using simple arrays6m 32s
-
Using two-dimensional arrays4m 17s
-
-
9. Creating Custom Classes
-
Understanding encapsulation7m 19s
-
Using constructor methods4m 56s
-
-
10. Working with Inheritance
-
11. Using Common Java Libraries
-
12. Preparing a Java Application for Deployment
-
Conclusion
-
Next steps1m 37s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Comparing string values