Show comments for this question (0) Add comments Link to this question
11. public void Examsheets(boolean a, boolean b){ 12. if(a){ 13. System.out.println(“A”); 14. }else if(a&&b){ 15. System.out.println(“A&&B”); 16. }else{ 17. if( !b ){ 18. System.out.println(“notB”); 19. }else{ 20. System.out.println(“ELSE”); 21. } 22. } 23. }
11. public class Test{ 12. public void Examsheets(){ 13. assert false; 14. assert false; 15. } 16. public void bar(){ 17. while(true){ 18. assert false; 19. } 20. assert false; 21. } 22. }
1. public interface Test{ 2. int frood=42; 3. } 4. class Testlmpl implements Test{ 5. public static void main(String[]args){ 6. System.out.printIn(++frood); 7. } 8. }
11. for (int i=0;i<3;i++){ 12. switch(i){ 13. case 0:break; 14. case 1:System.out.print(“one”); 15. case 2:System.out.print(“two”); 16. case 3:System.out.print(“three”); 17. } 18. } 19. System.out.println(“done”);
11. try{ 12. int x=0; 13. int y=5/x; 14. }catch(Exception c){ 15. System.out.println(“Exception”); 16. }catch(ArithmeticException ac){ 17. System.out.println(“Arithmetic Exception”); 18. } 19. System.out.println(“finished”);
10. public Object m(){ 11. Object o=new Float(3.14F); 12. Object[]oa=new Object[1]; 13. ao[0]=o; 14. o=null; 15. oa[0]=null; 16. return o; 17. }