FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaExercises/Java 2/HW1Lesson.java at master · biblelamp/JavaExercises · GitHub
biblelamp
/
JavaExercises
Public
Notifications
You must be signed in to change notification settings
Fork
130
Star
153
Code
Issues
1
Pull requests
9
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaExercises
/
Java 2
/
HW1Lesson.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (44 loc) · 1.47 KB
Breadcrumbs
JavaExercises
/
Java 2
/
HW1Lesson.java
Copy path
File metadata and controls
47 lines (44 loc) · 1.47 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
/**
* Java. Level 2. Lesson 1. Example of homework
* Preparatory actions:
* 1. Making zoo.jar based on code in lesson 1:
* - compile sourse files
* > javac hw1/animals/*.java
> javac hw1/obstacles/*.java
* - make package using command:
* > jar -cvf zoo.jar hw1/animals/*.class hw1/obstacles/*.class
* 2. Move package to lib/ directory
* > move animals.jar lib
* > move obstacles.jar lib
* 3. Compile using this command:
* > javac -cp lib/zoo.jar;. HW1Lesson.java
* Run compiled program this way:
* > java -cp lib/zoo.jar;. HW1Lesson
* 4. Or put package to [JDK]/jre/lib/ext
* and compile and run this way:
* > javac HW1Lesson.java
* > java HW1Lesson
*
* @author Sergey Iryupin
* @version 0.3.5 dated Jun 08, 2018
* @link https://github.com/biblelamp
*/
import
hw1
.
animals
.*;
import
hw1
.
obstacles
.*;
import
hw1
.*;
class
HW1Lesson
{
public
static
void
main
(
String
[]
args
) {
Course
cource
=
new
Course
(
new
Doable
[] {
// creating an obstacle course
new
Track
(
50
),
new
Water
(
50
),
new
Wall
(
2
)});
Team
team
=
new
Team
(
"Zoo"
,
new
Animal
[] {
// creating a team
new
Cat
(
"Murzik"
),
new
Cat
(
"Barsik"
),
new
Hen
(
"Izzy"
),
new
Hippo
(
"Hippopo"
)});
System
.
out
.
println
(
team
);
// to show team list
cource
.
doIt
(
team
);
// ask the team to pass the obstacle course
team
.
showResults
();
// to show results
}
}
Back
|
FazBrowse Home
|
New Git URL