Commit 5b4cecd7 authored by Martin Deinhofer's avatar Martin Deinhofer
Browse files

removed code instantiating a student object and a university object

fixed error not using variable webinarAcc
parent e0c89e13
...@@ -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());
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment