FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaRepository/ivanchuk/src/task24/TaskTest.java at master · karzhouAndrew/JavaRepository · GitHub
karzhouAndrew
/
JavaRepository
Public
Notifications
You must be signed in to change notification settings
Fork
16
Star
0
Code
Issues
0
Pull requests
96
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task24
/
TaskTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (25 loc) · 1.81 KB
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task24
/
TaskTest.java
Copy path
File metadata and controls
27 lines (25 loc) · 1.81 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
task24
;
//Создать иерархию классов, описывающих бытовую технику.
//Создать несколько объектов описанных классов, часть из них включить в розетку.
//Иерархия должна иметь хотя бы три уровня.
public
class
TaskTest
{
public
static
void
main
(
String
[]
args
) {
HouseholdAppliances
laptop
=
new
Laptop
(
"Apple"
,
2.4
,
2300
);
HouseholdAppliances
personalComputer
=
new
PersonalComputer
(
"Asus"
,
3.0
,
"Lg"
);
HouseholdAppliances
dvdPlayer
=
new
DVDPlayer
(
"Lg"
,
"DVD"
,
"HDMI"
);
HouseholdAppliances
homeTheater
=
new
HomeTheater
(
"Sony"
,
"DVD"
,
"Sony"
);
personalComputer
.
includeInSocket
();
homeTheater
.
includeInSocket
();
dvdPlayer
.
includeInSocket
();
personalComputer
.
switchOffFromSocket
();
System
.
out
.
println
(
"Laptop: "
+
laptop
.
getIncludedInSocket
() +
" "
+
laptop
.
getBrand
() +
" "
+ ((
Laptop
)
laptop
).
getProcessorPower
() +
" "
+ ((
Laptop
)
laptop
).
getBatteryCapacity
());
System
.
out
.
println
(
"PC: "
+
personalComputer
.
getIncludedInSocket
() +
" "
+
personalComputer
.
getBrand
() +
" "
+ ((
PersonalComputer
)
personalComputer
).
getProcessorPower
() +
" "
+ ((
PersonalComputer
)
personalComputer
).
getMonitorBrand
());
System
.
out
.
println
(
"DVD player: "
+
dvdPlayer
.
getIncludedInSocket
() +
" "
+
dvdPlayer
.
getBrand
() +
" "
+ ((
DVDPlayer
)
dvdPlayer
).
getSupportedFormats
() +
" "
+ ((
DVDPlayer
)
dvdPlayer
).
getInterfaces
());
System
.
out
.
println
(
"Home theater: "
+
homeTheater
.
getIncludedInSocket
() +
" "
+
homeTheater
.
getBrand
() +
" "
+ ((
HomeTheater
)
homeTheater
).
getSupportedFormats
() +
" "
+ ((
HomeTheater
)
homeTheater
).
getProjectorBrand
());
}
}
Back
|
FazBrowse Home
|
New Git URL