first commit
This commit is contained in:
commit
8c81ee28b7
3106 files changed
+474415
No files matched your search
@@ -0,0 +1,20 @@
|
||||
## Lecture 1 (11:00)
|
||||
|
||||
- We do not use == to validate string equality.
|
||||
- Instead, since string variables point to an object with a value of a series of letters, we can use the String method equals().
|
||||
|
||||
```java
|
||||
private String name1, name2;
|
||||
name1 = "Peter";
|
||||
name2 = new String "Peter";
|
||||
|
||||
public boolean isEqual( name1, name2 )
|
||||
{
|
||||
if ( name1.equals(name2) ) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user