Java - Interview Questions and Answers for 'Datametica' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Datametica' - 3 question(s) found - Order By Newest

Very frequently asked. Favorite question in Walk in Drive of many Indian service companies.
  Q1. Difference between TreeMap and HashMap ?Core Java
Anonymous
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     Amber Road  CTS (Cognizant)  ION Trading  DataMetica  Accenture  The Advisory Board Company  BidGely  Infosys  Tata Consultancy (TCS)  HCL Technologies  Wipro  Booking.com  MakeMyTrip  Garena Online  Garmin  ION Trading  Accuity  Palantir Technologies  Books International  Wealthfront  Marin Software  Garmin  IBM  Global Logic  Fiserv  Cumulus Systems  CCTS  UST Global      basic        frequent

Try 1 Question(s) Test


Related Questions

  Which of the following collections stores its elements in insertion Order ?

a. HashMap
b. TreeMap
c. LinkedHashMap
d. LinkedMap
  What is comparator interface used for ?
  Which of the following collection maintain its elements in Natural Sorted order ?
  Which are the sorted collections ?
  How can we reverse the order in the TreeMap ?
  TreeMap orders the elements on which field ?
  How TreeMap orders the elements if the Key is a String ?
  Can we add heterogeneous elements into TreeMap ?
  Will it create any problem if We add elements with key as user defined object into the TreeMap ?


 Q2. Explain static blocks in Java ?Core Java
Anonymous
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     Daffodil  Visa Inc  Logica  DataMetica  Tech Mahindra      basic        frequent


Related Questions

  How can we run a java program without making any object?
  Similarity and Difference between static block and static method ?
  How can we create objects if we make the constructor private ?
  Is it possible to compile and run a Java program without writing main( ) method?
  Will the static block be executed in the following code ? Why ?
  Will static block for Test Class execute in the following code ?
  Can we initialize member variables within static block ?
  How can we execute a Java class independently if it doesn't have a static main method ?


  Q3. Write a Program to check if 2 strings are Anagrams ?Core Java2016-11-30 20:52:37

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     Amazon  DataMetica  Hewlett Packard (HP)  Opera Solutions  AirWatch  Booking.com  JP Morgan  Verdantis  AppDynamics  QSI Healthcare  Vistaar Technologies  Maventic  5AM Solutions  Rare Mile Technologies  Shutterfly  Fiberlink  Veeva Systems  Flipkart  eHarmony  Splunk  Zoho  Betterment  WisdmLabs  Adap.tv  Spotify  Yahoo  Wissen Infotech  GlobalLogic      basic        frequent


Related Questions

  Difference between == and .equals() ?
  Why is String immutable in Java ?
  Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
  What are the difference between composition and inheritance in Java?
  Why do we need Inner classes ? Cant we just work with outer classes wherever we implement Inner classes ?
  What are different ways of object creation in Java ?
  What are points to consider in terms of access modifier when we are overriding any method?
  What are different ways to create String Object? Explain.
  What do you mean by "Java is a statically typed language" ?
 What is the difference between declaration, instantiation and initialization ?




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

1 person from are looking for questions for 'Datametica'. Connect with them to better prepare for your interview.
X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: