close
這個是字串比對程式自動顯示符合結果
且編譯成功完全無bug

 
//intern().replaceAll().contains()
import java.io.*;
public class te06
{

public static void main(String[] args)
{
String s1="merry christmas!!";
String s2="happy bithday!!";
String s3="happy new year!!";
String s4="happy";//
String s6=s1+s2+s3;

if((s6).contains(s4))
{

String s5=s4.intern();
String s7=s4.replaceAll(s5,s6);
System.out.println(s7);
}
}} 
 



--------------------Configuration: --------------------
merry christmas!!happy bithday!!happy new year!!

Process completed. 編譯成功 
arrow
arrow
    全站熱搜

    gtea0609 發表在 痞客邦 留言(0) 人氣()