Ú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?:))
- Steam Deck
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Gitáros topic
- Eredeti játékok OFF topik
- Háztartási gépek
- Építő/felújító topik
- Samsung Galaxy Felhasználók OFF topicja
- Milyen egeret válasszak?
- Tudományos Pandémia Klub
- További aktív témák...
- Dell 14 Latitude 7450 WUXGA 2in1 Touch X360 Ultra5 135U 12mag 16GB 512GB Win11 Pro WiFi7 Garancia
- BESZÁMÍTÁS! ASRock H510M i5 11400F 16GB DDR4 512GB SSD ASUS ROG RX VEGA64 8GB CM Masterbox 5 700W
- Xiaomi 15T Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- Dell Precision 7550 i7-10850H 32GB 512GB Nvidia RTX5000 16GB 1 év garancia
- Lenovo ThinkPad T14 Gen1 Intel i5-10310U Refurbished - Garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

