package data;
public class Test {
public static void main(String[] args) {
/* String str="abcccdefcdh";
String[] arr=str.split("c");
System.out.println(arr.length);
for (int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
}*/
/*int a=1;
int b=1;
Integer c=a+b;
System.out.println(c);*/
/* String s1 = new String("hello");
String s2 = new String("hello");
System.out.println(s1==s2);
System.out.println(s1.equals(s2));
String s3 = new String("hello");
String s4 = "hello";
System.out.println(s3==s4);
System.out.println(s3.equals(s4));
String s5 = "hello";
String s6 = "hello";
System.out.println(s5==s6);
System.out.println(s5.equals(s6));
*/
StringBuffer sb=new StringBuffer();
sb.append("hello");
StringBuffer sb1=new StringBuffer();
sb1.append("world");
StringBuffer sb2=new StringBuffer();
/* sb2=sb1;
System.out.println(sb2);*/
change(sb,sb1);
/*System.out.println(sb);
System.out.println(sb1);*/
}
public static void change(StringBuffer a,StringBuffer b)
{
//StringBuffer sb2=new StringBuffer();
//sb2=a;
a=b;
// System.out.println(a);
b.append("java");
a.append("girl");
System.out.println(a);
System.out.println(a);
System.out.println(b);
}
}
|
|