Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
githubmendong
java-study
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
java-study
/
chapter03
/
src
/
main
/
java
/
tv
/
WatchTV.java
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
54 lines (43 loc) · 1.52 KB
master
Breadcrumbs
java-study
/
chapter03
/
src
/
main
/
java
/
tv
/
WatchTV.java
Copy path
Top
File metadata and controls
Code
Blame
54 lines (43 loc) · 1.52 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
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
//아래 WatchTV 클래스의 main 메쏘드를 실행할 수 있도록, UML 그림과 요구 조건을 참조하여 TV 클래스를 정의 하세요.
//1) 모든 필드는 private으로 접근 제어를 하고 getter만 작성합니다. (channel, volume, power 필드는 read-only)
//2) channel, volume, power의 초기값을 각각 7, 20, false 로 초기화 하는 생성자 작성
//3) 기본 생성자 오버로딩
//4) void power( boolean on ) 메소드 구현
//5) void channel( int channel ) 메소드 구현 (1~255 유지)
//6) void channel( boolean up ) 메소드 오버로딩 (1~255 유지, 1씩 증감)
//7) void volume( int voluem ) 메소드 구현 ( 0 ~ 100 유지 )
//8) void volume( boolean up ) 메소드 오버로딩 (0 ~ 100 유지, 1씩 증감)
//9) void status() 메소드 구현( TV 정보 출력)
//TV
//int channel
//int volume
//boolean power
//getChannel()
//getVolueme()
//isPower()
//power( boolean )
//channel( int )
//channel( boolean )
//volume( int )
//volume( boolean )
//status();
package
tv
;
public
class
WatchTV
{
public
static
void
main
(
String
[]
args
) {
TV
tv
=
new
TV
(
7
,
20
,
false
);
tv
.
status
();
tv
.
power
(
true
);
tv
.
volume
(
120
);
tv
.
status
();
tv
.
volume
(
false
);
tv
.
status
();
tv
.
channel
(
0
);
tv
.
status
();
tv
.
channel
(
true
);
tv
.
channel
(
true
);
tv
.
channel
(
true
);
tv
.
status
();
tv
.
power
(
false
);
tv
.
status
();
}
}
You can’t perform that action at this time.