Long description

The lines read as follows. Line 1. forward slash forward slash Fig period J period 6 colon Time Comparator period java. Line 2. forward slash forward slash Custom Comparator class that compares two Time 2 objects period. Line 3. import java period u t i l period Comparator semicolon. Line 4. Blank. Line 5. public class Time Comparator implements Comparator less than sign Time 2 greater than sign. Line 6. left brace. Line 7, indented once. public i n t compare left parenthesis Time 2 time 1 comma Time 2 time 2 right parenthesis. Line 8, indented once. left brace. Line 9, indented twice. I n t hour Compare equals time 1 period get Hour left parenthesis right parenthesis dash time 2 period get Hour left parenthesis right parenthesis ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.