
Java Stack Class Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
Jay Ho
Used 2+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary principle on which the Stack class in Java is based?
First-in-first-out (FIFO)
Last-in-first-out (LIFO)
First-in-last-out (FILO)
Last-in-last-out (LILO)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to add an element to the top of the stack?
add()
insert()
push()
append()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to remove the top element from the stack?
discard()
pop()
delete()
remove()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the peek() method do in a Stack?
Returns the top element without removing it
Adds an element to the top
Checks if the stack is empty
Removes the top element
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which interface does the Stack class implement?
Queue
List
Set
Map
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the search() method return if the element is not found in the stack?
null
0
-1
An exception
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
Stack
2
An exception
1
null
Create a free account and access millions of resources
Similar Resources on Wayground
17 questions
Cuestionario de Certificación JS 2024

Quiz
•
12th Grade
11 questions
What is Linux?

Quiz
•
10th Grade - University
15 questions
Uji Pemahaman Algoritma dan Pemrograman

Quiz
•
12th Grade
17 questions
Stacks

Quiz
•
KG - Professional Dev...
10 questions
C# Programming Quiz

Quiz
•
12th Grade
10 questions
Tes Diagnostik

Quiz
•
9th - 12th Grade
15 questions
Web Development Quiz

Quiz
•
12th Grade - University
14 questions
AP CSA Variables and Operators

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade