-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartPhone.java
More file actions
35 lines (26 loc) · 696 Bytes
/
SmartPhone.java
File metadata and controls
35 lines (26 loc) · 696 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 com.tyss.inheritance;
/* if we extends one class with another class the things present in that class will be accessible by this class
*/
/*Sub class*/
public class SmartPhone extends Phone{
int camera;
int cameraCount;
public SmartPhone(int price,int ram,int c,int d) {
super(price,ram);
camera=c;
cameraCount=d;
System.out.println("subclass loaded.........");
}
public SmartPhone(int price,int ram) {
super(price,ram);
//camera=camera;
//cameraCount=cameraCount;
System.out.println("subclass loaded");
}
public void play() {
System.out.println("playing chess");
}
public void selfie() {
System.out.println("taking selfie with my dude");
}
}