class Test {
public static void main
( String [ ] args
) { test( 'h' , 'e' , 'l' , 'l' , 'o' ) ;
test( 'm' , 'a' , 'i' , 'n' ) ;
}
static void test( char ... arg ) {
+ ( s1!= s2? " existed" : " did not exist" ) + " in the pool before" ) ;
System .
out .
println ( "is the same as \" hello\" : " + ( s2
== "hello" ) ) ; System .
out .
println ( "is the same as \" main\" : " + ( s2
== "main" ) ) ; }
}
CmNsYXNzIFRlc3QgewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIHRlc3QoJ2gnLCAnZScsICdsJywgJ2wnLCAnbycpOwogICAgICAgIHRlc3QoJ20nLCAnYScsICdpJywgJ24nKTsKICAgIH0KICAgIHN0YXRpYyB2b2lkIHRlc3QoY2hhci4uLiBhcmcpIHsKICAgICAgICBTdHJpbmcgczEgPSBuZXcgU3RyaW5nKGFyZyksIHMyID0gczEuaW50ZXJuKCk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCciJytzMSsnIicKICAgICAgICAgICAgKyhzMSE9czI/ICIgZXhpc3RlZCI6ICIgZGlkIG5vdCBleGlzdCIpKyIgaW4gdGhlIHBvb2wgYmVmb3JlIik7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJpcyB0aGUgc2FtZSBhcyBcImhlbGxvXCI6ICIrKHMyPT0iaGVsbG8iKSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJpcyB0aGUgc2FtZSBhcyBcIm1haW5cIjogIisoczI9PSJtYWluIikpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigpOwogICAgfQp9