Tag: collection

  • Java 21 – Sequenced Collections

    How do you get the last element of a list in Java? Using a code similar to below: That doesn’t look elegant! And how do you get the last element for a Sorted Set? That looks much more elegant but then different collections are having different ways to get the last element. There is no…

  • How to create a Database and perform CRUD operations in MongoDB through command prompt?

    MongoDB is one of the most popular NoSQL databases . Instead of inserting rows into tables as in traditional relational databases you insert documents into collections in a MongoDB. The documents have the structure of a JSON. And the documents dont have to have a defined structure as tables need to in a relational database.…