Search Interview Questions | Click here and help us by providing the answer. Click Correct / Improve and please let us know. |
|
|||
|
| |||||||||||
| Interview Questions and Answers - Order By Newest | |||||||||||
| |||||||||||
| Ans. equals, compareTo and hashcode are of use when the objects are used within collections. Equals helps with collections that helps maintaining only unique objects ( like Set ) compare and compareTo helps with collections that helps maintaining objects in order ( TreeSet, TreeMap etc ) hascode helps with collections that facilitates hash searching ( like hashSet, hashMap etc ) | |||||||||||
| |||||||||||
| Ans. public Set convertArrayToList(T array[]) { Set set = new HashSet<>(Arrays.asList(array)); return set; } | |||||||||||
| |||||||||||
| Ans. public List convertAllToUpperCase(List words) { return words.stream().map(String::toUpperCase).collect(Collectors.toList()); } @Test public void testAllToUpperCase() { List expected = Arrays.asList("JAVA8", "STREAMS"); List result = convertAllToUpperCase(Arrays.asList("java8", "streams")); assertEquals(expected, result); } | |||||||||||
| |||||||||||
| Ans. Broad question, but if the company need velocity, think about use a NO SQL instead of regular SQL databases. Also prefers materialized views instead of joins to fetch data quickly. Regarding the database design, there are very good design tools for professional database (to develop proper indexes and good database design) one of the best is QuickDBD | |||||||||||
| |||||||||||