Contenu connexe
Similaire à Naïveté vs. Experience (20)
Naïveté vs. Experience
- 13. Essential Boilerplate equals hashCode get set public Foo toString try catch finally ; { } @override static int System.out boolean . void import String Exception throws toString toString throws throws finally finally finally get get equals hashCode try } System.out boolean toString throws throws finally get public Foo catch finally ; int import String Exception throws toString get equals get toString try finally static import String toString throws finally equals try toString throws get finally String Exception hashCode finally { @override int void Exception toString throws finally hashCode toString throws finally public Foo finally int Exception @override static finally hashCode try throws throws static @override hashCode throws hashCode @override void toString toString int hashCode void finally finally public Foo int hashCode @override void toString toString int hashCode void finally finally public Foo int hashCode @override void toString toString int hashCode void finally finally public Foo int toString static finally equals try finally String toString throws finally toString finally
- 46. (spouse != null ? " married to " + spouse.getFirstName() + "." : "." ); } }
- 48. (spouse != null ? " married to " + spouse.getFirstName() + "." : "." ); } }
- 50. (spouse != null ? " married to " + spouse.getFirstName() + "." : "." ); } }
- 52. (spouse != null ? " married to " + spouse.getFirstName() + "." : "." ); } }
- 54. override def toString(): String = firstName + " " + lastName +
- 57. case Some(s) => " married to " + s.firstName + "."
- 59. } By default , Scala classes are immutable.
- 64. ( str fname " " lname
- 66. ( str " married to " n))
- 67. ))) By default , Scala classes are immutable.
- 127. } By default , Scala classes are immutable.
- 153. When a tree falls in a lonely forest ... does it make a sound? – Charles Riborg Mann and George Ransom Twiss
- 154. If a pure function mutates some local data in order to produce an immutable return value, is that ok? – Rich Hickey