in Education by
How is Arrays.asList() different than the standard way of initialising List? (a) Both are same (b) Arrays.asList() throws compilation error (c) Arrays.asList() returns a fixed length list and doesn’t allow to add or remove elements (d) We cannot access the list returned using Arrays.asList() The question was asked in an interview for job. My question is taken from Data Structures-List in division java.util – The Collections Framework of Java Select the correct answer from above options Java questions and answers, Java questions pdf, Java question bank, Java questions and answers pdf, mcq on Java pdf, Java questions and solutions, Java mcq Test , Interview Java questions, Java Questions for Interview, Java MCQ (Multiple Choice Questions),Core Java Questions, Core Java MCQ,core java interview questions for experiencedcore java interview questions for 3 years experience,java programming questions,core java interview questions for freshers,java interview questions and answers for freshers, java programming questions and answers pdf, java interview questions for beginners

1 Answer

0 votes
by
 
Best answer
The correct answer is (c) Arrays.asList() returns a fixed length list and doesn’t allow to add or remove elements Easiest explanation: List returned by Arrays.asList() is a fixed length list which doesn’t allow us to add or remove element from it.add() and remove() method will throw UnSupportedOperationException if used.

Related questions

0 votes
    Which of these standard collection classes implements a linked list data structure? (a) AbstractList (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Arrays in Java are implemented as? (a) class (b) object (c) variable (d) none of the mentioned ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    putchar() printf() getchar() write() Select the correct answer from above options Java questions and answers, ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Standard output variable out' is defined in which class? (a) Void (b) Process (c) Runtime (d) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a standard for communicating multimedia content over email? (a) http (b) https (c ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements a dynamic array? (a) AbstractList (b) LinkedList (c) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is returned by greater than , less than and equal to operators? (a) Integers ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the process of defining more than one method in a class differentiated by method signature? (a) ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the process of defining more than one method in a class differentiated by parameters? (a) Function ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the process of defining more than one method in a class differentiated by parameters? (a) Function ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the value returned by function compareTo() if the invoking string is less than the string compared? ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What is the value returned by function compareTo() if the invoking string is greater than the string compared ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these methods return a smallest whole number greater than or equal to variable X? (a) double ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these method returns a largest whole number less than or equal to variable X? (a) double ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    How to remove duplicates from List? (a) HashSet listToSet = new HashSet(duplicateList); (b) HashSet listToSet ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...