Examsnet
Unconfined exams practice
Home
Exams
Banking Entrance Exams
CUET Exam Papers
Defence Exams
Engineering Exams
Finance Entrance Exams
GATE Exam Practice
Insurance Exams
International Exams
JEE Exams
LAW Entrance Exams
MBA Entrance Exams
MCA Entrance Exams
Medical Entrance Exams
Other Entrance Exams
Police Exams
Public Service Commission (PSC)
RRB Entrance Exams
SSC Exams
State Govt Exams
Subjectwise Practice
Teacher Exams
SET Exams(State Eligibility Test)
UPSC Entrance Exams
Aptitude
Algebra and Higher Mathematics
Arithmetic
Commercial Mathematics
Data Based Mathematics
Geometry and Mensuration
Number System and Numeracy
Problem Solving
Board Exams
Andhra
Bihar
CBSE
Gujarat
Haryana
ICSE
Jammu and Kashmir
Karnataka
Kerala
Madhya Pradesh
Maharashtra
Odisha
Tamil Nadu
Telangana
Uttar Pradesh
English
Competitive English
Certifications
Technical
Cloud Tech Certifications
Security Tech Certifications
Management
IT Infrastructure
More
About
Careers
Contact Us
Our Apps
Privacy
Test Index
Assertions
Show Para
Hide Para
Share question:
© examsnet.com
Question : 6
Total: 6
Which are true? (Choose all that apply.)
It is appropriate to use assertions to validate arguments to methods marked public.
It is appropriate to catch and handle assertion errors.
It is NOT appropriate to use assertions to validate command-line arguments.
It is appropriate to use assertions to generate alerts when you reach code that should notbe reachable.
It is NOT appropriate for assertions to change a program’s state.
Validate
Solution:
C , D, and E are correct statements.
A is incorrect. It is acceptable to use assertions to test the arguments of private methods. B is incorrect. While assertion errors can be caught, Sun discourages you from doing so.
© examsnet.com
Go to Question:
1
2
3
4
5
6
Prev Question