20. public float getSalary(Employee e) { 21. assert validEmployee(e); 22. float sal = lookupSalary(e); 23. assert (sal>0); 24. return sal; 25. } 26. private int getAge(Employee e) { 27. assert validEmployee(e); 28. int age = lookupAge(e); 29. assert (age>0); 30. return age; 31. } Which line is a violation of appropriate use of the assertion mechanism?()
- A、 line 21
- B、 line 23
- C、 line 27
- D、 line 29
正确答案:A
答案解析:有
微信扫一扫手机做题