adplus-dvertising
frame-decoration

Question

Which of these methods deletes all the elements from invoking collection?

a.

clear()

b.

reset()

c.

delete()

d.

refresh()

Posted under Java Programming

Answer: (a).clear()

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of these methods deletes all the elements from invoking collection?

Similar Questions

Discover Related MCQs

Q. Which of this interface is not a part of Java’s collection framework?

Q. Which of these classes is not part of Java’s collection framework?

Q. Which of these packages contain all the collection classes?

Q. Which of these package provides the ability to read and write in Zip format?

Q. Which of these interfaces is implemented by TimerTask class?

Q. Which of these classes can schedule task for execution in future?

Q. Which of these methods is called when observed object has changed?

Q. Which of these methods calls update() method?

Q. Which of these methods is used to notify observer the change in observed object?

Q. What is the use of Observable class?

Q. Which of these is a method can generate a boolean output?

Q. Which of these method of Locale class can be used to obtain country of operation?

Q. Which of these class can generate pseudorandom numbers?

Q. Which of these methods is not a Locale class?

Q. Which of these class produce objects with respect to geographical locations?

Q. What is the signature of Math.random() method?

Q. Math.random() guarantees uniqueness?

Q. What would be the output of following code snippet?

int a = random.nextInt(7) + 4;

Q. What would be the output of following code snippet?

int a = random.nextInt(15) + 1;

Q. How many bits are used for generating random numbers?