/** * Author: Josiah Yoder et al. * Class: SE1011-051 * Lesson: Week 7, Day 2 */ import java.util.Scanner; public class Example051_7_2 { public static void main(String[] ignored) { // Class: A definition of a new type that is built from primitive types, reference ' // types, and methods // Object: Instance of a class // Instance: A particular copy of a class with its own location in memory and values // for each instance variable // Reference: A 'pointer' indicating the location of an object in memory Scanner in = new Scanner(System.in); Compex051_7_2 c = new Compex051_7_2(3,4); Compex051_7_2 c2 = new Compex051_7_2(0,0); Compex051_7_2 c3 = new Compex051_7_2(0,0); // We have not implemented these yet. // c3 = c.add(c2); // c3 = c.subtract(c2); // c3 = c.multiply(c2); // c3 = c.divide(c2); // We have not implemented these yet. // How would you put them in the UML diagram? // c.dance(); // :-) // c3 = c.pow(c2); // c.radicalArgument(); // c.radicalMagnitude(); // // c.magnitude(); // alternative name for radical magnitude // this is just the method by itself, with the return value ignored // Example of getting the return value back and storing it in a variable double mag = c.magnitude(); } }