Java SimpleTimeZone.equals(Object obj)

Syntax

SimpleTimeZone.equals(Object obj) has the following syntax.

public boolean equals(Object obj)

Example

In the following code shows how to use SimpleTimeZone.equals(Object obj) method.


/*from   w ww  .  ja  v a2  s  .c o  m*/

import java.util.SimpleTimeZone;

public class Main {
   public static void main( String args[] ){
      // create two simple time zone objects 
      SimpleTimeZone stobj1 = new SimpleTimeZone(720,"India");
      SimpleTimeZone stobj2 = new SimpleTimeZone(720,"India");
      
      // compare two objects      
      System.out.println("Comparison result: " + stobj1.equals(stobj2));
   }      
}

The code above generates the following result.