1. It’s present in java.util.package
  2. we can use comparator interface to define our own sorting

http://www.punjabicenter.com/?iuf=%D8%A7%D9%84%D8%B3%D9%88%D9%82-%D8%A7%D9%84%D8%A7%D8%B3%D9%87%D9%85-%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A السوق الاسهم السعودي

  1. http://spaplaceinc.com/b11-PLAZA-QRD/Cholesterol-Qn/-7-8033.html بيع الاسهم عن طريق البنك الاهلي public int compare(Object obj1, Object obj2)
    returns –ve number if obj1 has to come before obj2
    returns +ve nuber if obj1 has to come after obj2
    returns 0 if obj1 and obj2 are equal.
  2. http://www.cottonwoodproperties.com/?rabik=%D8%A7%D8%B3%D9%88%D8%A7%D9%82-%D8%A7%D9%84%D9%85%D8%A7%D9%84-%D8%AA%D8%AF%D8%A7%D9%88%D9%84&2b8=b8 اسواق المال تداول public boolean equals(Object obj)
    When ever we are implementing comparator interface compulsory we should provide implementation for compare method. Implementing equals method is optional because it is already available from object class through inheritance.

http://novadistance.se/?tybot=%D8%A7%D9%81%D8%B6%D9%84-%D9%85%D9%88%D9%82%D8%B9-%D8%AA%D9%88%D8%B5%D9%8A%D8%A7%D8%AA-%D8%A7%D9%84%D8%A7%D8%B3%D9%87%D9%85&d7b=75 افضل موقع توصيات الاسهم

اسعار الذهب اليوم في السويد import java.util.Comparator; import java.util.TreeSet; public class TreeSetComparatorDemo { public static void main(String[] args) { TreeSet t = new TreeSet(new MyComparator()); t.add(10); t.add(5); t.add(15); t.add(20); t.add(0); System.out.println(t); } } class MyComparator implements Comparator { public int compare(Object obj1, Object obj2) { Integer I1 = (Integer) obj1; Integer I2 = (Integer) obj2; if (I1 < I2) return +1; else if (I1 > I2) return -1; else return 0; } } /* Output: [20, 15, 10, 5, 0] */

افضل شركات فوركس

forex mini account di indonesia

اخبار الفوركس اليوم public int compare(Object obj1, Object obj2){ Integer I1 = (Integer)obj1; Integer I2 = (Integer)obj2; return I1.compareTo(I2);// [0,5,10,15,20] //return I2.compareTo(I1); // [20,15,10,5,0] //return -I1.compareTo(I2); // [20,15,10,5,0] //return -I2.compareTo(I1); // [0,5,10,15,20] //return I2-I1;//[20,15,10,5,0] //return I1-I2; // [0,5,10,15,20] }

سعر الذهب مباشر في السعودية

public int compare(Object obj1, Object obj2){ return -1; // [0,20,15,5,10] (reverse of Insertion order) //return 1; // [10,5,15,20,0] (Insertion Order) //return 0; // [10] (All the remaining elements considered as duplicate objects) }

http://lacomunal.com/tag/plan-b/ سعر بدء تداول اسهم الحكير Example :insert String Objects to the TreeSet Where the Sorting order is reverse of Alphabetical order.

package com.java2learn.collections;
import java.util.Comparator;
import java.util.TreeSet;

public class TreeSetComparatorStringDemo {

	public static void main(String[] args) {
		TreeSet t = new TreeSet(new MyComparatorString());
		t.add("Davidson");
		t.add("Beck");
		t.add("Bloch");
		t.add("Fleury");
		t.add("Mcclanahan");
		t.add("Johnson");
		t.add("Gosling");
		t.add("Gavin");
		//
		System.out.println(t);
	}
}

class MyComparatorString implements Comparator {
	public int compare(Object obj1, Object obj2) {
		String s1 = (String) obj1;
		String s2 = (String) obj2;
		return s2.compareTo(s1);
	}
}
/*Output
[Mcclanahan, Johnson, Gosling, Gavin, Fleury, Davidson, Bloch, Beck]
*/