1. public class X ( 2. public object m () { 3. object o = new float (3.14F); 4. object [] oa = new object [1]; 5. oa[0]= o; 6. o = null; 7. return oa[0]; 8. } 9. }
Show comments for this question (0) Add comments Link to this question
1. public class IfTest ( 2. public static void main(string[]args) { 3. int x = 3; 4. int y = 1; 5. if (x = y) 6. system.out.printIn(“Not equal”); 7. else 8. system.out.printIn(“Equal”); 9. } 10. )
1. public class test ( 2. public static void main(string args[]) { 3. int 1= 0; 4. while (i) { 5. if (i==4) { 6. break; 7. ) 8. ++i; 9. ) 10. 11. ) 12. )
3. int i= 1, j= 10 ; 4. do ( 5. if (i++> --j) continue; 6. ) while (i<5);
1. switch (i) { 2. default: 3. System.out.printIn(“Hello”); 4. )
1. public class foo { 2. public static void main (string[]args) 3. try {return;} 4. finally {system.out.printIn(“Finally”);} 5. } 6. )
1. import java.io.IOException; 2. public class ExceptionTest( 3. public static void main (String[]args) 4. try ( 5. methodA(); 6. ) catch (IOException e) ( 7. system.out.printIn(“Caught IOException”); 8. ) catch (Exception e) ( 9. system.out.printIn(“Caught Exception”); 10. ) 11. ) 12. public void methodA () { 13. throw new IOException (); 14. ) 15. )