File tree Expand file tree Collapse file tree
core-java/src/main/java/com/baeldung/javac Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .baeldung .javac ;
22
3- import java .io .Serializable ;
43import java .util .ArrayList ;
54import java .util .List ;
65
7- public class Data implements Serializable {
8- static List <String > textList = new ArrayList ();
6+ public class Data {
7+ List <String > textList = new ArrayList ();
98
10- private static void addText () {
11- textList .add ("baeldung" );
12- textList .add ("." );
13- textList .add ("com" );
9+ public void addText (String text ) {
10+ textList .add (text );
1411 }
1512
1613 public List getTextList () {
17- this .addText ();
18- List <String > result = new ArrayList <String >();
19- String firstElement = (String ) textList .get (0 );
20- switch (firstElement ) {
21- case "baeldung" :
22- result .add ("baeldung" );
23- case "com" :
24- result .add ("com" );
25- }
26- return result ;
14+ return this .textList ;
2715 }
28- }
16+ }
You can’t perform that action at this time.
0 commit comments