Day 34:
Did you know about the .intern() method in Java?
It creates an exact copy of a string object in memory.
For example:
str = new String(โjsonโ)
str1 = new String(โjsonโ)
str == str1 returns false
But slap a .intern() on there and it equals true!
#100DaysOfCode
Day 5:
Whatโs the difference between a method and a constructor?
A method gives functionality to an object. // tells it what to do
A constructor initializes the object values. // get values to use
Am I right? ๐ฅฒ
#100DaysOfCode