Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Datametica' - 4 question(s) found - Order By Newest | ||||
Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. | ||||
| ||||
Ans. They are different the way their elements are stored in memory. TreeMap stores the Keys in order whereas HashMap stores the key value pairs randomly. | ||||
Sample Code for treemap Sample Code for hashmap | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   map   treemap   hashmap   treemap vs hashmap Asked in 31 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
Very frequently asked.Usually among first few questions. | ||||
| ||||
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application 1. Controller receives the requests and handles overall control of the request 2. Model holds majority of the Business logic, and 3. View comprise of the view objects and GUI component | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay Asked in 60 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
| ||||
Ans. A static initialization block is a normal block of code enclosed in braces, { }, and preceded by the static keyword. Here is an example: static { // whatever code is needed for initialization goes here } A class can have any number of static initialization blocks, and they can appear anywhere in the class body. The runtime system guarantees that static initialization blocks are called in the order that they appear in the source code. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   static   static block Asked in 16 Companies basic   frequent | ||||