Skip to content

Commit

Permalink
Immutable Bert And Ernie
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperancinha committed Feb 3, 2024
1 parent 7178f53 commit 1bc527f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ public String helloBert() {
final String helloErnie = "and I'm Ernie";
return helloBert.concat(" ").concat(helloErnie);
}

public String helloBertClean(){
return "Hello! I'm Bert and I'm Ernie";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ class BertAndErnieLauncher {
companion object {
@JvmStatic
fun main(args: Array<String>) {
println(ImmutableBertAndErnie().helloBert())
println(ImmutableBertAndErnieJava().helloBert())
println(ImmutableBertAndErnieJava().helloBertClean())
println(ImmutableBertAndErnie().helloBert())
println(ImmutableBertAndErnie().helloBertClean())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ class ImmutableBertAndErnie {
val hello = "Hello! I'm Bert"
return "$hello and I'm Ernie"
}

fun helloBertClean() = "Hello! I'm Bert and I'm Ernie"
}

0 comments on commit 1bc527f

Please sign in to comment.