Hirdetés
Új hozzászólás Aktív témák
-
sztikac
őstag
Ha már MOOC... Van ez a kód:
public boolean equals(Object compared) {
// if the variables are located in the same position, they are equal
if (this == compared) {
return true;
}
// if the compared object is not of type Person, the objects are not equal
if (!(compared instanceof Person)) {
return false;
}
// convert the object into a Person object
Person comparedPerson = (Person) compared;
// if the values of the object variables are equal, the objects are equal
if (this.name.equals(comparedPerson.name) &&
this.age == comparedPerson.age &&
this.weight == comparedPerson.weight &&
this.height == comparedPerson.height) {
return true;
}
// otherwise the objects are not equal
return false;
}Itt nem igazán értem, hogy a type cast-ra (
Person comparedPerson = (Person) compared;) mi szükség van, hiszen a metódus már megkapja a compared objektumot
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Debrecen és környéke adok-veszek-beszélgetek
- OLED monitor topic
- Okos Otthon / Smart Home
- KODI (ex-XBMC) Android alapokon, Androidos media-boxok
- Kuponkunyeráló
- Parkside szerszám kibeszélő
- Sorozatok
- Linux Mint
- Nvidia GPU-k jövője - amit tudni vélünk
- Milyen billentyűzetet vegyek?
- További aktív témák...
- 27% ÁFÁS DELL Alienware 16X Aurora Ultra 7 / RTX 5060 Részletfizetés megoldható. Beszámítás van.
- Újszerű APPLE Macbook Pro 16" - M3 Pro - 18GB - 512GB SSD - 23 Ciklus - 100% akku -ezüst- 2+ év gar
- Bomba ár! Dell Latitude 5495 - Ryzen 5 I 8-16GB I 256SSD I 14" FHD I HDMI I Radeon I Cam I W11 I Gar
- iKing.hu Apple iPhone 15 Pro Max 256GB használt Black Titanium 91% akku 6 hónap garancia
- ÁRGARANCIA!Épített KomPhone i5 14400F 32/64GB RAM RX 9060 XT 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


