FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hackerrank-java-basic-skill-test/src/TestThread.java at master · rakeshmatha/hackerrank-java-basic-skill-test · GitHub
rakeshmatha
/
hackerrank-java-basic-skill-test
Public
forked from
anishLearnsToCode/hackerrank-java-basic-skill-test
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
hackerrank-java-basic-skill-test
/
src
/
TestThread.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (27 loc) · 640 Bytes
Breadcrumbs
hackerrank-java-basic-skill-test
/
src
/
TestThread.java
Copy path
File metadata and controls
31 lines (27 loc) · 640 Bytes
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
class
SampleDemo
implements
Runnable
{
private
Thread
t
;
private
String
threadName
;
SampleDemo
(
String
threadName
) {
this
.
threadName
=
threadName
;
}
@
Override
public
void
run
() {
while
(
true
) {
System
.
out
.
println
(
threadName
);
}
}
public
void
start
() {
if
(
t
==
null
) {
t
=
new
Thread
(
this
,
threadName
);
t
.
start
();
}
}
}
public
class
TestThread
{
public
static
void
main
(
String
[]
args
) {
SampleDemo
A
=
new
SampleDemo
(
"A"
);
SampleDemo
B
=
new
SampleDemo
(
"B"
);
B
.
start
();
A
.
start
();
}
}
Back
|
FazBrowse Home
|
New Git URL