// // Supporting material for lecture 13 // // create an object of a given class // play with it // public class Demo13 { public static void main(String[] args){ Person x = new Person("Patrick","Prosser",21); Person y = new Person("Andrea","Turnbull",18); Person z = new Person("Zoe","Prosser"); x.marry(y); System.out.println(x); System.out.println(y); System.out.println(z); String s = z.getName(); if (z.isMarried()) s = s + " is married"; else s = s + " is not married"; System.out.println(s); } } // // NOTES // - how things are constructed // - note two different constructors // - how we call methods, such as getName and marry // - automatic use of toString in System.out.println! // //