StringBuffer , SubString ,equals and == concepts in java
SOURCE : Test.javapublic class Test { static int total=10; int i[]={0}; public static void main(String[] args) { int i[]={1}; change(i); System.out.println(i[0]); StringBuffer sb1 = new StringBuffer("abc"); StringBuffer sb2 = new StringBuffer("abc"); System.out.println(sb1==sb2); String s = "abc"; System.out.println(sb1.equals(sb2)); System.out.println("poddar".substring(3)); System.out.println(sb1.equals(s)); } private static void change(int[]i) { int j[]={2}; i=j;} public Test(){ int temp =this.total; if(temp>5){ System.out.println(temp); } }}INPUTOUTPUT1falsefalsedarfalse

0 comments :
Post a Comment