We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb94352 commit daa33b3Copy full SHA for daa33b3
1 file changed
modules/src/main/java/com/platzi/functional/_10_chaining/Chaining.java
@@ -0,0 +1,29 @@
1
+package com.platzi.functional._10_chaining;
2
+
3
+public class Chaining {
4
+ public static void main(String[] args) {
5
+ StringBuilder stringBuilder = new StringBuilder();
6
+ stringBuilder.append("Hola")
7
+ .append("alumno")
8
+ .append("de")
9
+ .append("platzi");
10
11
+ Chainer chainer = new Chainer();
12
13
+ Chainer chainer2 = chainer.sayHi();
14
+ Chainer chainer3 = chainer2.sayBye();
15
+ chainer.sayHi().sayBye();
16
+ }
17
18
+ static class Chainer {
19
+ public Chainer sayHi() {
20
+ System.out.println("Hola");
21
+ return this;
22
23
24
+ public Chainer sayBye() {
25
+ System.out.println("Bye");
26
27
28
29
+}
0 commit comments