Professional Documents
Culture Documents
String and Arrayiy
String and Arrayiy
String and Arrayiy
Ans: -
String char
(i) String is a class under java.lang package. (i) char is a kind of primitive data type.
(ii) String does not occupies any fixed size of memory. (ii) char occupies 2 bytes of memory.
(iii) String data represents with double quotation (" (iii) char data represents with single quotation ('
"). ').
(i) String represents fixed length. (i) StringBuffer represents length of changing values.
(ii) Objects are immutable i.e., once created (ii) Objects are mutable i.e., they can be manipulated
they cannot be changed. and modified as desired.
(i) It is used to check whether a given character is in (i) It is used to convert any string or character
upper case or not. into upper case.
(i) This function only checks whether two (i) This function checks whether a String is equal, bigger or
Strings are identical or not. smaller than other String or not.
(i) Adjacent element is compared and (i) Largest element is selected and swapped with the last element
swapped. (Ascending order).
(ii) Less efficient than Selection sort. (ii) Comparatively more efficient than Bubble sort.
(iii) Slower than Selection sort. (iii) Faster than Bubble sort.
(ii) The search begins at the start of (ii) An array divided into two halves and then the desired data item
an array i.e., from 0th index. is searched either in the first half or in the second half.
(i) It is represented along X-axis. (i) It is represented along X-axis and Y-axis.
(ii) The variables with same name have (ii) The variables with same name have two types of subscript
single subscript. representing row and column.