You need to create a method to clear a Queue named q.
Which code segment should you use?
A.
foreach (object e in q) {
q.Dequeue();
}
B.
foreach (object e in q) {
Enqueue(null);
}
C.
q.Clear();
D.
q.Dequeue();
You need to create a method to clear a Queue named q.
Which code segment should you use?
You need to create a method to clear a Queue named q.
Which code segment should you use?
A.
foreach (object e in q) {
q.Dequeue();
}
B.
foreach (object e in q) {
Enqueue(null);
}
C.
q.Clear();
D.
q.Dequeue();