-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhoneApp.java
More file actions
35 lines (26 loc) · 906 Bytes
/
PhoneApp.java
File metadata and controls
35 lines (26 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package Homerwork.HW_280923;
public class PhoneApp {
public static void main(String[] args) {
ButtonPhone buttonPhone = new ButtonPhone(3435);
buttonPhone.setPhoneName("ButtonPhone ");
buttonPhone.call(654321);
buttonPhone.receiveCall(948758);
SmartPhone smartPhone = new SmartPhone(35);
smartPhone.setPhoneName("SmartPhone ");
smartPhone.call(457);
smartPhone.receiveCall(9875);
RadioPhone radioPhone = new RadioPhone(46);
radioPhone.setPhoneName("RadioPhone ");
radioPhone.call(8746);
radioPhone.receiveCall(76566498);
Phone phone = new Phone();
Phone[] phones = {buttonPhone, smartPhone, radioPhone};
makeCall(phones);
}
// ??? со *
private static void makeCall(Phone[] phones) {
for (Phone phone : phones){
phone.call(1);
}
}
}