How to sort objects in java using Comparator?

In the below example class Student has three fields

Name, Age & Mark

Now i am showing 2 types of sorting here

  1. by Name
  2. by Mark
Comparator is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference. This interface is a member of the Java Collections Framework.

Teaser of - is a free online tools website. You can use it free of cost. We are trying to add new tools in this website.

Online QR Code Generator

 Online QR Code Generator is used to generate QR code online and download easily. A QR code (Quick Response Code) is a type of matrix barcode (or two-dimensional barcode). A barcode is a machine-readable optical label that contains information about the item to which it is attached. In practice, QR codes often contain data for a locator, identifier, or tracker that points to a website or application. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to store data efficiently; extensions may also be used.

Online Barcode Generator

 Online Barcode Generator is used to generate barcode online and download easily. A barcode or bar code is a method of representing data in a visual, machine-readable form. Initially, barcodes represented data by varying the widths and spacings of parallel lines. These barcodes, now commonly referred to as linear or one-dimensional (1D), can be scanned by special optical scanners, called barcode readers.

Convert Date and Time to Milliseconds

 Date and Time Converter is used to convert Date & Time to Milliseconds.