申論題內容
三、有下列 JAVA 程式片段,請寫出執行結果。(20 分)
String s4 = new String(“restful”) ;
String s5 = new String(“restful”) ;
String s6 = new String(“peaceful”) ;
String s7 = s4 ;
String s8 = “restful” ;
String s9 = “restful” ;
System.out.println(s4.equals(s5)) ;
System.out.println(s4.equals(s6)) ;
System.out.println(s4 == s5) ;
System.out.println(s4 == s7) ;
System.out.println(s4 == s8) ;
System.out.println(s8 == s9) ;