-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
36 lines (29 loc) · 867 Bytes
/
Copy pathTester.java
File metadata and controls
36 lines (29 loc) · 867 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
36
package com.qb.israel.inheritance;
public class Tester {
public static void main(String [] args){
new Tester();
}
public Tester()
{
Phone landLine = new Phone();
SmartPhone smartPhone = new SmartPhone();
System.out.println("about to test a landline phone as a phone");
testPhone(landLine);
System.out.println("about to test a smartPhone phone as a phone");
testPhone(smartPhone);
System.out.println("about to test a smartPhone phone as a smartPhone");
testSmartPhone(smartPhone);
System.out.println("Another test");
Phone testPhone = new SmartPhone();
testPhone.isRinging();
}
private void testPhone(Phone phone){
phone.callNumber(1234567890);
phone.isRinging();
}
private void testSmartPhone(SmartPhone phone){
phone.sendEmail();
phone.retrieveEmail();
phone.isRinging();
}
}