in Education by
What is the correct method used to insert and delete items from the queue? (a) push and pop (b) enqueue and dequeue (c) enqueue and peek (d) add and remove This question was posed to me by my school principal while I was bunking the class. The query is from Data Structures-Queue in section 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
Correct choice is (b) enqueue and dequeue The best explanation: enqueue is pushing item into queue; dequeue is removing item from queue; peek returns object without removing it from queue. Stack uses push and pop methods. add and remove are used in the list.

Related questions

0 votes
    Which of these method is used to insert value and its key? (a) put() (b) set() (c) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these methods can be used to delete the last element in a LinkedList object? (a) remove() ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What is the difference between Queue and Stack? (a) Stack is LIFO; Queue is FIFO (b) Queue is ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a subinterface of Queue? (a) BlockingQueue (b) BlockingEnque (c) TransferQueue ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Where does a new element be inserted in linked list implementation of a queue? (a) Head of list (b ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which annotation is used to represent command line input and assigned to correct data type? (a) @Input (b ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these method of class String is used to extract a single character from a String object? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this method of class String is used to extract a substring from a String object? (a) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these method of FileReader class is used to read characters from a file? (a) read() (b) ... 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 method of ObjectInput interface used to deserialize an object from a stream? (a) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these method is used to remove all keys/values pair from the invoking map? (a) delete() ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is correct about passing an argument by call-by-value process? (a) Copy of argument ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is not a correct statement? (a) A recursive method must have a base case (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B? ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these is not a correct statement? (a) Every class containing abstract method must be declared ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...