News:

Build a stunning handcrafted website with IT Acumens

Main Menu

Proxy Equals() Example

Started by VelMurugan, Dec 30, 2008, 11:35 PM

Previous topic - Next topic

VelMurugan

Proxy Equals() Example

Compares this object against the specified object

Proxyclass Equals() method example. This example shows you how to use Equals() method.This method Compares this object against the specified object

Here is the code:-

/*
* @Program that Returns true if the objects are the same; false otherwise.
* Equals.java
* Author:-RoseIndia Team
* Date:-23-Jun-2008
*/

import java.net.*;

public class Equals {

    public static void main(String[] args) {
        SocketAddress ss = new InetSocketAddress("girish-desktop", 8080);
        Proxy p = new Proxy(Proxy.Type.SOCKS, ss);
        Proxy p1 = new Proxy(Proxy.Type.SOCKS, ss);
        // Returns true if the objects are the same; false otherwise.
        System.out.println("Objects are the same: "+p.equals(p1));
       
    }
}


Output of the program:-

Objects are the same: true


Source : codingdiary