in Education by
What should the return type of method where there is no return value? (a) Null (b) Empty collection (c) Singleton collection (d) Empty String I have been asked this question in quiz. I'm obligated to ask this question of Coding best practices topic in chapter Autoboxing & Miscellaneous of Java Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Right option is (b) Empty collection Explanation: Returning Empty collection is a good practice. It eliminates chances of unhandled null pointer exceptions.

Related questions

0 votes
    A function with no return value is called ___________ (a) Procedures (b) Method (c) Static function ( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
0 votes
    What is the return type of Math.random() method? (a) Integer (b) Double (c) String (d) Boolean ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the return type of the method parseInt()? (a) String (b) Float (c) Integer (d) Date ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    What is the return type of lambda expression? (a) String (b) Object (c) void (d) Function This ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the return type of typeof for standard JavaScript objects? (a) xml (b) object (c) dom (d ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What is the return type of the hash property? (a) Query string (b) Packets (c) String (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What is the return type of the script tag? (a) File I/O (b) Minify JavaScript (c) HTTP Request ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
...