Comparable interface - Basic Java Fast (32)

Share this & earn $10
Begin Coding Fast
Published at : 19 Sep 2021
743 views
8
0

The video discusses the compareTo method from the Comparable interface. Two String objects can be compared in lexicographic order using the compareTo method. For user-defined classes, one can define the compareTo method by comparing the instance variables of two objects.

You’ll learn most by trying my code while watching the video.

1:45 - compareTo method of strings
7:58 - Defining your own compareTo method

Playlist of my Java course
https://www.youtube.com/playlist?list=PLtQo0sxRN7JLr647f8RTzS58u8Rv5jxT5

Playlist of my Java examples
https://www.youtube.com/playlist?list=PLtQo0sxRN7JKKla3_GAF05dySjyy3nINa

java comparablejava comparetojava comparable interface

THE MANY SAINTS OF NEWARK - Meet The Cast: Old But New

THE MANY SAINTS OF NEWARK - Meet The Cast: Old But New

Kevin becomes a teenager - BBC comedy

Kevin becomes a teenager - BBC comedy

English Vocabulary for hotel amenities

English Vocabulary for hotel amenities

Depeche Mode - Enjoy The Silence (Live on Letterman)

Depeche Mode - Enjoy The Silence (Live on Letterman)

WHAT IF… CELEBRITIES had FIFA Cards! 😂🤪

WHAT IF… CELEBRITIES had FIFA Cards! 😂🤪

REPLAY: Title Slopestyle presented by CLIF

REPLAY: Title Slopestyle presented by CLIF

That's The Way It Is - Celine Dion (Lyrics) 🎵

That's The Way It Is - Celine Dion (Lyrics) 🎵

The natural way to use much, many, a lot of and lots of

The natural way to use much, many, a lot of and lots of

Toy Hunt Outdoor for 5 Surprise with Ryan ToysReview

Toy Hunt Outdoor for 5 Surprise with Ryan ToysReview

So Large - Half Time [Music Video] | GRM Daily

So Large - Half Time [Music Video] | GRM Daily

Homogeneous and Heterogeneous Mixture | Difference between homogeneous and heterogeneous mixture

Homogeneous and Heterogeneous Mixture | Difference between homogeneous and heterogeneous mixture

Consideration Rihanna Feat SZA

Consideration Rihanna Feat SZA

John Negroponte remembers Colin Powell: ‘An absolutely great American’

John Negroponte remembers Colin Powell: ‘An absolutely great American’

10 online stores to get AFFORDABLE trendy clothes | best places to shop online for trendy clothes

10 online stores to get AFFORDABLE trendy clothes | best places to shop online for trendy clothes

ALL 38 Silk Flower Locations | Complete Guide & Efficient Route | Genshin Impact Liyue

ALL 38 Silk Flower Locations | Complete Guide & Efficient Route | Genshin Impact Liyue

idfc slowed - blackbear (Lyrics) "I'm only a fool for you" [TikTok Remix]

idfc slowed - blackbear (Lyrics) "I'm only a fool for you" [TikTok Remix]

The Folks Who Live On The Hill - Vasilis Xenopoulos and Paul Edis

The Folks Who Live On The Hill - Vasilis Xenopoulos and Paul Edis

Amazing MINI AIR CONDITIONER made with Recyclable Materials

Amazing MINI AIR CONDITIONER made with Recyclable Materials

Conserving our Environment | Science | Grade-4,5 | TutWay |

Conserving our Environment | Science | Grade-4,5 | TutWay |

A Distinct Approach to Capital Investment: Alternative Investment Funds

A Distinct Approach to Capital Investment: Alternative Investment Funds

Hakan Akkus - I Can't Be (Original Mix)(Video Edit) + Lyrics

Hakan Akkus - I Can't Be (Original Mix)(Video Edit) + Lyrics

Emma and Lyndon Learn about Swimming Pool Rules | Kids Swim

Emma and Lyndon Learn about Swimming Pool Rules | Kids Swim

Matt Monro   -  All Of A Sudden

Matt Monro - All Of A Sudden

Meghan Trainor - Me Too

Meghan Trainor - Me Too

Doble P Ache Ene - Invaluable

Doble P Ache Ene - Invaluable

Crumb - Locket [Official Video]

Crumb - Locket [Official Video]

Top 5 Favorites 2021

Top 5 Favorites 2021

Treatments for dementia: The dementia guide

Treatments for dementia: The dementia guide

Burke's Backyard, Cochin Chook Road Test

Burke's Backyard, Cochin Chook Road Test

Ο Σάκης και η Μαριαλένα μαζί στο "Love it" | 14/07/2021

Ο Σάκης και η Μαριαλένα μαζί στο "Love it" | 14/07/2021

Involve The Community !

Involve The Community !

Man Takes 10 Years to Build Handcrafted Home For His Family! | Grand Designs

Man Takes 10 Years to Build Handcrafted Home For His Family! | Grand Designs

They Can't

They Can't

Beautiful Relaxing Hymns, Peaceful Instrumental Music, "Autumn Sunlit Morning Sunrise" By Tim Janis

Beautiful Relaxing Hymns, Peaceful Instrumental Music, "Autumn Sunlit Morning Sunrise" By Tim Janis

The Weeknd - Valerie (Vladish Edit)

The Weeknd - Valerie (Vladish Edit)

Why this investor says to stick with Adobe despite its new record high

Why this investor says to stick with Adobe despite its new record high

Young Mountain Biker Faces Paralysis After Accident | Helicopter ER

Young Mountain Biker Faces Paralysis After Accident | Helicopter ER

Cade Cunningham Is MUCH Better Than You Think (HERE'S WHY)

Cade Cunningham Is MUCH Better Than You Think (HERE'S WHY)

Pretty

Pretty

Be Concerned

Be Concerned

Most Lovely Emirates Wedding bil baz

Most Lovely Emirates Wedding bil baz

Brian Laundrie theory that he is on Appalachian Trail is ‘certainly plausible,’ ex-FBI agent claims

Brian Laundrie theory that he is on Appalachian Trail is ‘certainly plausible,’ ex-FBI agent claims

The surprising secret to speaking with confidence | Caroline Goyder | TEDxBrixton

The surprising secret to speaking with confidence | Caroline Goyder | TEDxBrixton

I Almost Finished My CL65 AMG But The First Drive Attempt Ended Horribly! Wait Until You See This!

I Almost Finished My CL65 AMG But The First Drive Attempt Ended Horribly! Wait Until You See This!

EL GRAN COMBO - COMBUSTIBLE

EL GRAN COMBO - COMBUSTIBLE

Future - First Off (Audio) ft. Travis Scott

Future - First Off (Audio) ft. Travis Scott

John Mayer - You're No One 'Til Someone Lets You Down (Official Audio)

John Mayer - You're No One 'Til Someone Lets You Down (Official Audio)

25 most commonly used Proverbs and their Meaning

25 most commonly used Proverbs and their Meaning

Will Ferrell Shows Up Instead of Ryan Reynolds

Will Ferrell Shows Up Instead of Ryan Reynolds