forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestCourse.java
More file actions
executable file
·31 lines (29 loc) · 1.16 KB
/
TestCourse.java
File metadata and controls
executable file
·31 lines (29 loc) · 1.16 KB
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
/* */ package ch10;
/* */
/* */ public class TestCourse {
/* */ public static void main(String[] args) {
/* 5 */ Course course1 = new Course("Data Structures");
/* 6 */ Course course2 = new Course("Database Systems");
/* */
/* 8 */ course1.addStudent("Peter Jones");
/* 9 */ course1.addStudent("Brian Smith");
/* 10 */ course1.addStudent("Anne Kennedy");
/* */
/* 12 */ course2.addStudent("Peter Jones");
/* 13 */ course2.addStudent("Steve Smith");
/* */
/* 15 */ System.out.println("Number of students in course1: " + course1
/* 16 */ .getNumberOfStudents());
/* 17 */ String[] students = course1.getStudents();
/* 18 */ for (int i = 0; i < course1.getNumberOfStudents(); i++) {
/* 19 */ System.out.print(students[i] + ", ");
/* */ }
/* 21 */ System.out.println();
/* 22 */ System.out.print("Number of students in course2: " + course2
/* 23 */ .getNumberOfStudents());
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch10/TestCourse.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/