Map in Java & HashMap example | Java Collections # 9 | Java9s.com

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 9

  • @turskyi
    @turskyi 5 ปีที่แล้ว +1

    Your "download link " does not work.

  • @marekbugiel6893
    @marekbugiel6893 8 ปีที่แล้ว

    Didn't know one could set ownerName from default constructor using:
    ownerName= name.toString();
    but apparently overriding toString method to one like this:
    public String toString(){
    return this.ownerName;
    }
    does the work. That was one more interesting thing learnt along learning how the HashMap works. Thanks.

  • @mayankparihar1988
    @mayankparihar1988 8 ปีที่แล้ว +1

    Here is solution for first question... Thanks very much for your kind video its very helpful.....
    import java.util.Comparator;
    public class CustomComparator implements Comparator {
    @Override
    public int compare(Employee o1, Employee o2) {
    // TODO Auto-generated method stub
    /*System.out.println("entered");
    System.out.println(o1.getEmpName().compareTo(o2.getEmpName()));
    int result = o1.getEmpName().compareTo(o2.getEmpName());
    if(result>0)
    return -1;
    else if(result < 1)
    return 1;
    return 0;
    }*/
    if(o1.getEmpid()%2==0 && o2.getEmpid()%2!=0)
    {
    return -1;
    }
    else if(o1.getEmpid()%2!=0 && o2.getEmpid()%2==0)
    {
    return 1;
    }
    return 0;

    }
    }

  • @adityabhardwaj3606
    @adityabhardwaj3606 8 ปีที่แล้ว

    Hi which tool you are using for create this animation?

    • @java9s
      @java9s  8 ปีที่แล้ว

      +Aditya Bhardwaj animatecc

    • @adityabhardwaj3606
      @adityabhardwaj3606 8 ปีที่แล้ว +1

      +java9s Thanks Sir you are so Kind .God Bless you.

    • @adityabhardwaj3606
      @adityabhardwaj3606 8 ปีที่แล้ว

      +Aditya Bhardwaj Animatecc is free or paid??

    • @java9s
      @java9s  8 ปีที่แล้ว +1

      +Aditya Bhardwaj it is from Adobe. It is paid

  • @thyagtubes
    @thyagtubes 4 ปีที่แล้ว

    Nice tutorial