-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoop18.java
103 lines (64 loc) · 1.96 KB
/
oop18.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import java.util.Scanner;
interface Wifi{
String []userName();
String []password();
}
interface camera{
void TurOn();
void TSnap();
}
class cellphone{
void call(){
System.out.println("Do you wan tot call !!");
}
void ring(){
System.out.println("Ringing !!");
}
}
class SmartPhone extends cellphone implements camera,Wifi{
Scanner sc = new Scanner(System.in);
String [] username= new String[100];
public String [] userName(){
System.out.println("Add atmost 10 username for wifi");
for(int i=1;i<10;i++){
System.out.println("Adding username No "+i);
username[i]=sc.nextLine();
}
System.out.println("Printing username");
for(int i=1;i<10;i++){
System.out.println("username"+username[i]);
}
return username;
}
public String[] password(){
String [] password= new String[100];
int n;
System.out.println("Enter password of enter usernames in order");
for(int i=1;i<10;i++){
System.out.println("Adding password No "+i);
password[i]=sc.nextLine();
}
System.out.println("Printing [passwords]");
for(int i=1;i<10;i++){
System.out.println("Password "+password[i]);
}
return password;
}
public void TurOn(){
System.out.println("Turning on camers");
}
public void TSnap(){
System.out.println("Takling Snap");
}
}
public class oop18 {
public static void main(String[] args) {
SmartPhone smartPhone= new SmartPhone();
camera camera= new SmartPhone();
smartPhone.userName();
smartPhone.password();
smartPhone.TSnap();
smartPhone.TurOn();
camera.TurOn();
}
}