Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
embedded_systems_public
Java-Exercises-2-OOP1
Commits
5b4cecd7
Commit
5b4cecd7
authored
Nov 16, 2017
by
Martin Deinhofer
Browse files
removed code instantiating a student object and a university object
fixed error not using variable webinarAcc
parent
e0c89e13
Changes
1
Show whitespace changes
Inline
Side-by-side
src/java_exercises2_2_1/TestUni.java
View file @
5b4cecd7
...
@@ -13,12 +13,6 @@ import java_exercises2_1_1.University;
...
@@ -13,12 +13,6 @@ import java_exercises2_1_1.University;
*/
*/
public
class
TestUni
{
public
class
TestUni
{
public
static
void
main
(
String
[]
args
)
throws
MalformedURLException
{
public
static
void
main
(
String
[]
args
)
throws
MalformedURLException
{
//Instantiate student called Martin
Student
student
=
new
Student
(
"Martin"
,
1
);
University
uni
=
new
University
();
//Register student
uni
.
register
(
student
);
Course
javaEmbedded
=
new
Course
(
"Java for Embedded Systenms"
,
1
);
Course
javaEmbedded
=
new
Course
(
"Java for Embedded Systenms"
,
1
);
//Due to the overridden toString method we can print the contents of the object with System.out.println
//Due to the overridden toString method we can print the contents of the object with System.out.println
System
.
out
.
println
(
"Course javaEmbedded: "
+
javaEmbedded
);
System
.
out
.
println
(
"Course javaEmbedded: "
+
javaEmbedded
);
...
@@ -29,6 +23,6 @@ public class TestUni {
...
@@ -29,6 +23,6 @@ public class TestUni {
Webinar
webinarWebAcc
=
new
Webinar
(
"Make accessible web sites"
,
2
,
new
URL
(
"http://webinars.com/webaccess"
));
Webinar
webinarWebAcc
=
new
Webinar
(
"Make accessible web sites"
,
2
,
new
URL
(
"http://webinars.com/webaccess"
));
System
.
out
.
println
(
"Course webinarWebAcc: "
+
webinarWebAcc
);
System
.
out
.
println
(
"Course webinarWebAcc: "
+
webinarWebAcc
);
//But you can also access the member values with the respective getter methods.
//But you can also access the member values with the respective getter methods.
System
.
out
.
println
(
"Course: id:"
+
javaEmbedded
.
getId
()+
", name: "
+
javaEmbedded
.
getName
()+
", URL: "
+
webinarWebAcc
.
getWebinarURL
());
System
.
out
.
println
(
"Course: id:"
+
webinarWebAcc
.
getId
()+
", name: "
+
webinarWebAcc
.
getName
()+
", URL: "
+
webinarWebAcc
.
getWebinarURL
());
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment