Difference

what is diffence between comparator and compatable in JAVA

Definition Both interfaces are very similer because they are for sorting lists and arrays. However, one is for one condition and other one is for mutiple conditions. Difference Comparable Comparator java.lang package. java.util package. Comparable affects the original class Comparator doesn’t affect the original class compareTo() method with 1 parameter compare() method with 2 parameters Collections.sort(List) Collections.sort(List, Comparator) Arrays.

what is difference between Error and Exception in Java

What is Error Programs run something that is not what programmers wanted or shutdown unexpectedly. Any causes of that action are Error. Kinds of Errors compile-time error compile failed. usually, wrong lanuage keyword used. python does not understand “System.out.println” This code is for JAVA. runtime error crash during the programs run. put values in int arr[5] that array size is 3 logical error programmer created wrong process. you wanted to put blue in variable x.