How to (and how not to) compare Strings in Java; Intro to Java (full course) Lesson 3 Video 3

preview_player
Показать описание
This series of videos is suitable for programmers with minimal (or no) programming experience who want to learn Java. You cannot compare Strings with the relational operators (well, you can, but you won't be comparing the characters in the string), so this video explains why and shows the proper way to compare strings.

There is a suggested (free) book below that you could read along with the videos lessons. However, the video is very straightforward and can also stand alone or accompany any other introductory Java textbook. Let's have some fun learning to program in Java!

PLAYLIST

BOOK AND WEBSITE RESOURCES

This video is suitable to watch after reading Chapters 2 and 3 of Introduction to Programming Using Java, by David J. Eck:

The Elements of Java Style text is available here*:
*As an Amazon Associate I earn from qualifying purchases. Your purchases help me continue to bring you content!

Here is the Oracle documentation for String:

The basic latin chart:

The list of notable African-American women in Computer Science from Wikipedia:

Dr. Marian Croak patent interview:

Mary Jackson video from NASA:

The Open JDK page is here:

The Eclipse IDE page is here:

PRACTICE

You can practice writing the code from the video here*:

If you want to earn credit for learning to code, take an online course at CCRI! These videos are part of the Java Programming course:

GET THE CODE

The github repository with all of the code examples for Lesson 3 is here:

RESOURCE ATTRIBUTIONS

Java JDK image from Oracle:

Java coffee cup image:

00:00 Welcome and review of relational operators
00:39 The wrong way
01:59 Why it's wrong (primitives, objects, and stack/heap)
06:30 Properly comparing strings
Рекомендации по теме