ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the issue compareTo() method in Java?public int compareTo(Object o){ Employee emp = (Employee) emp; return this.id - o.id;} id integer

user-image
تم إضافة السؤال من قبل Muhammed Rahshad Koyippalli , Cisco DNAC Senior Escalation Engineer , Cisco Systems - India
تاريخ النشر: 2014/05/24
Naser Ali
من قبل Naser Ali , Technical Specialist , Robert Bosch Engineering and Business Solutions India Pvt. Ltd

When you use subtraction, there is a possibility that you might overrun the limit of the integers and it might return a bad result. Because integer ranges from -32767 to +32768... so when you overstep this range through subtraction, it may produce undesired results.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟