ObjectCopy.java - public class ObjectCopy/Uses Stock...

This preview shows page 1 out of 1 page.

public class ObjectCopy //Uses Stock class's copy method { public static void main(String[] args) { Stock company1 = new Stock ("XYZ", 9.62); Stock company2; company2 = company1.copy(); System.out.println("Company 1:\n" + company1); System.out.println(); System.out.println("Company 2:\n" + company2);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture