### Source code for EqualsVersusEqualsMethodExample.java:

>     public class EqualsVersusEqualsMethodExample
>     {
>     	public static void main(String args[])
>     	{
>     		// EqualsVersusEqualsMethodExample
>     		Double d1 = new Double(1.23);
>     		Double d2 = new Double(1.23);
>     		Double d3 = new Double(4.56);
>     		Double d4 = d1;
>     		System.out.println(d1 == d1);
>     		System.out.println(d1 == d2);
>     		System.out.println(d1 == d3);
>     		System.out.println(d1 == d4);
>     		System.out.println(d1.equals(d1));
>     		System.out.println(d1.equals(d2));
>     		System.out.println(d1.equals(d3));
>     		System.out.println(d1.equals(d4));
>     	}
>     }

### Output from EqualsVersusEqualsMethodExample.java:

    true
    false
    false
    true
    true
    true
    false
    true

--- Output Ends ---

#### NOTE:

You are reading previously generated output. You are not currently running the EqualsVersusEqualsMethodExample application at the momement. You need to compile and run the source code first.

#### To run this program:

`
- javac EqualsVersusEqualsMethodExample.java
- java EqualsVersusEqualsMethodExample
`

Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR