Triplet hauv Java yog dab tsi?
Triplet hauv Java yog dab tsi?

Video: Triplet hauv Java yog dab tsi?

Video: Triplet hauv Java yog dab tsi?
Video: Qhia yam ntxwv qua tsev Zoo thiab kev zas kob li cas thiaj raug looj mem || Loojmem Tsevyaj EP6 2024, Kaum ib hlis
Anonim

A Triplet yog Tuple los ntawm JavaTuples lub tsev qiv ntawv uas cuam tshuam nrog 3 lub ntsiab lus. Txij li qhov no Triplet yog ib chav kawm dav dav, nws tuaj yeem tuav txhua yam ntawm tus nqi hauv nws. Lawv sib piv (implements Comparable) Lawv siv equals() thiab hashCode() Lawv kuj siv toString()

Ntawm no, triplet yog dab tsi hauv Python?

triplet pythagoreanarrayc++ python . Ib Pythagorean triplet yog set {a, b, c} xws li a 2 = b 2 + c 2 a^2 = b^2+ c^2 a2?=b2?+c2?.

Ib yam li ntawd, tuple hauv Java yog dab tsi? A tuple tsuas yog ib ntu ntawm cov khoom uas tsis tas yuav cuam tshuam rau ib leeg hauv txhua txoj kev. Piv txwv li: [23, "Saturn", java ua [email tiv thaiv] tuaj yeem suav tias yog a tuple ntawm peb lub ntsiab lus (ib triplet) uas muaj ib qho Integer, ib txoj hlua, thiab JDBC Connection khoom.

Kuj paub yog, dab tsi yog array triplet?

Muab ib array thiab tus nqi, nrhiav yog tias muaj triplet hauv array nws cov sum yog sib npaug rau tus nqi muab. Piv txwv li, yog tias muab array yog {12, 3, 4, 1, 6, 9} thiab muab sum yog 24, ces muaj ib tug triplet (12, 3 thiab 9) tam sim no hauv array nws sum 24.

Puas yog Java muaj ob chav kawm?

A Pair yog ib lub thawv ntim ib tuple ntawm ob yam khoom. Java tsis tshua muab ib qho kev siv ntawm cov Pair chav kawm . Hauv tsab xov xwm no, peb yuav tham txog ntau yam kev xaiv rau Pair chav hauv Java . Pair yog feem ntau pab tau los taug qab ob yam khoom ua ke.

Pom zoo: