EqualsTest.java


Dosyayı İndir
public class EqualsTest {
    public static void testPrimitive() {
        int one=2;
        int two=2;
        int three=one;
        System.out.println("one     : "+one);
        System.out.println("two     : "+two);
        System.out.println("three   : "+three);
        System.out.println("one == two      : "+ (one == two) );
        System.out.println("one == three      : "+ (one == three) );
    } 
    public static void testClass() {
        Integer one=new Integer(2);
        Integer two=new Integer(2);
        Integer three=one;
        System.out.println("one     : "+one);
        System.out.println("two     : "+two);
        System.out.println("three   : "+three);
        System.out.println("one.equals(two) : "+ (one.equals(two))) ;
        System.out.println("one == two      : "+ (one == two) );
        System.out.println("one.equals(three) : "+ (one.equals(three)));
        System.out.println("one == three      : "+ (one == three) );          
    }
    public static void main(String[] args) {
        testClass();
    }
}

				
Dosyayı İndir

Bu Sayfayı Paylaş:




Bu Sayfayı Paylaş:

İletişim Bilgileri

Takip Et

Her Hakkı Saklıdır. Bu sitede yayınlanan tüm bilgi ve fikirlerin kullanımından fibiler.com sorumlu değildir. Bu sitede üretilmiş , derlenmiş içerikleri, fibiler.com'u kaynak göstermek koşuluyla kendi sitenizde kullanılabilirsiniz. Ancak telif hakkı olan içeriklerin hakları sahiplerine aittir