🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Pagination and Sorting: all 10 questions

Quiz: Pagination and Sorting · Question 5 of 10

What is the main difference between Page<T and Slice<T?

What is the main difference between Page<T> and Slice<T>?

  1. A.Slice cannot be sorted
  2. B.Page is faster
  3. C.Page runs an extra COUNT query to know the total; Slice only knows whether a next slice exists
  4. D.Slice returns all rows
Answer & explanation

Correct answer: Page runs an extra COUNT query to know the total; Slice only knows whether a next slice exists

Skipping the count query makes Slice cheaper for "load more" style screens.

Can you get the rest right without peeking?

Take the timed Quiz: Pagination and Sorting quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →