Legfrissebb anyagok
Mobilarena témák
- Samsung Galaxy S26 Ultra - fontossági sorrend
- Apple iPhone 17e – mágnesek ereje
- Xiaomi 13T és 13T Pro - nincs tétlenkedés
- Apple Watch Sport - ez is csak egy okosóra
- Milyen okostelefont vegyek?
- Apple iPhone 17 - alap
- Huawei Watch GT 6 és GT 6 Pro duplateszt
- Oppo a Vivónak: hagyd otthon a telekonvertert!
- MWC 2026: Bajnoki címre pályázik a Xiaomi Watch 5
- Jolla és SailfishOS tapasztalatcsere
PROHARDVER! témák
IT café témák
LOGOUT témák
Keresés
Új hozzászólás Aktív témák
-
pvt.peter
őstag
elég sokféleképpen meglehet oldani
Obj.java
package bikeshop;
public class Obj {
private final int ordertime;
private final boolean ordertype;
private int price;
public Obj(int ordertime, boolean ordertype) {
this.ordertime = ordertime;
this.ordertype = ordertype;
this.price = (this.ordertime >= 1 && this.ordertime <= 5) ? 10 : 30;
this.price += this.ordertype ? 10 : 5;
}
public int getPrice() {
return this.price;
}
}Main.java
package bikeshop;
public class Main {
public static void main(String[] args) {
Obj obj = new Obj(5, false);
System.out.println("Price: " + obj.getPrice());
}
}
Új hozzászólás Aktív témák
Téma tudnivalók
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
Aktív témák
Új fizetett hirdetések
- HP Elitebook 830 G5,FHD,13.3",i5-8350U,8GB DDR4,256GB SSD,WIN11,IR kamera
- Apple Watch Ultra 2 (2023) GPS + Cellular, Black Titanium /1,5év Garancia!/ Akku 98%
- Új, bontatlan, iPhone 17 Pro Max gyárilag kártya-független, apple világgaranciával
- MPG Z490 GAMING PLUS + Intel Core i7-10700K 8-Core 3.8GHz LGA1200 + Kingston FURY Beast 16GB (2x8GB)
- Dell Latitude 5290,12.5",i5-7300U,8GB DDR4,256GB SSD,WIN11
Üzleti előfizetők hirdetései
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest




