BadStockCompare.java - This program demonstrates how you...

This preview shows page 1 out of 1 page.

/**This program demonstrates how you cannot usethe == operator to compare two objects anddetermine whether they contain the same values.*/public class BadStockCompare{public static void main(String[] args){// Create two Stock objects with the same values.Stock company1 = new Stock("XYZ", 9.62);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture