File tree Expand file tree Collapse file tree
src/main/java/challenge21_40 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 <groupId >org.apache.maven.plugins</groupId >
1414 <artifactId >maven-compiler-plugin</artifactId >
1515 <configuration >
16- <source >12 </source >
17- <target >12 </target >
16+ <source >13 </source >
17+ <target >13 </target >
1818 </configuration >
1919 </plugin >
2020 </plugins >
Original file line number Diff line number Diff line change 1+ package challenge21_40 ;
2+
3+ /**
4+ *
5+ * the intern method == and equals method
6+ * 12568
7+ */
8+ public class Challenge_30 {
9+ public static void main (String [] args ) {
10+ String result = "" ;
11+ result += "powerfullcode " .trim () == "powerfullcode" ? "0" :"1" ;
12+ result += "flexibleCode" == "flexibleCode" ? "2" :"3" ;
13+ result += new String ("doYourBest" )==new String ("doYourBest" ) ? "4" :"5" ;
14+ result += new String ("nobugProject" ).equals ("nobugProject" ) ? "6" :"7" ;
15+ result += new String ("breakYourLimits" ).intern ()==new String ("breakYourLimits" ).intern () ? "8" :"9" ;
16+ System .out .println (result );
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments