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

Search Java Interview Questions


 2137 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 'Compro technologies' - 9 question(s) found - Order By Newest

Frequently asked in all types of companies especially Indian Services companies. Frequently asked in CTS (Based on 2 feedback)
 Q1. What is the use of hashcode in Java ?Core Java
Anonymous
Ans. Hashcode is used for bucketing in Hash implementations like HashMap, HashTable, HashSet etc. The value received from hashcode() is used as bucket number for storing elements. This bucket number is the address of the element inside the set/map. when you do contains() then it will take the hashcode of the element, then look for the bucket where hashcode points to and if more than 1 element is found in the same bucket (multiple objects can have the same hashcode) then it uses the equals() method to evaluate if object are equal, and then decide if contain() is true or false, or decide if element could be added in the set or not.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   collections   hashcode   advanced     Cognizant (CTS)  Compro Technologies  VigLink  Proofpoint      intermediate        frequent

Try 1 Question(s) Test


  Q2. What is a Destructor ? Do we have Destructors in Java ?Core Java

Ans. Destructor is used to de-allocate memory allocated by objects.

There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     destructor  garbage collection     Mahindra Comviva  Quinnox  MathWorks  Wipro  Publishers Clearing House (PCH)  Compro Technologies      Basic        frequent

Try 1 Question(s) Test


 Q3. Write a Program to reverse a Linked List ?Data Structure2016-12-13 14:58:09

 This question was recently asked at 'Myntra,Compro Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          Myntra  Compro Technologies


 Q4. Write a Program to print count of each character in a String.Core Java2017-01-27 20:32:20

Ans. public class BuggyBread {
public static void main(String args[]) {
Map<Character, Integer> countMap = new HashMap();
String str = "hello world";
for (char character : str.toCharArray()) {
if (countMap.containsKey(character)) {
countMap.put(character, countMap.get(character) + 1);
} else {
countMap.put(character, 1);
}
}
System.out.println(countMap);
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     String  Code  Coding  Character     Compro Technologies


 Q5. Write a program for 0 and cross games? Core Java2017-03-27 08:48:50

 This question was recently asked at 'Compro Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     code.coding.0 and cross game     Compro Technologies


 Q6. Given 2 jars of 5 ltr and 3 ltr, how will you get 4 ltrs in one of those jars ?Puzzle2017-03-27 08:38:54

 This question was recently asked at 'Compro Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve          Compro Technologies


 Q7. Why do we need Garbage collection ?Core Java2017-03-27 08:44:06

Ans. Garbage collection mechanism frees up the memory that is no longer needed. In languages like C / C++ the deallocation needs to be done explicitly by the programmer and hence any leniency may result in memory leak. Garbage collection in java ensures that all unused memory is reclaimed and hence there are no memory leaks.Moreover it relieves the programmer from the hassle of carefully releasing all memory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     Garbage Collection  memory management     Compro Technologies


 Q8. Write a Program to merge two sorted arrays ?Data Structure2017-03-27 08:46:57

 This question was recently asked at 'Compro Technologies,ECI Telecom'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     arrays  merge sorted arrays     Compro Technologies  ECI Telecom


 Q9. Find the third last element in a linked list ?Data Structure2017-03-27 08:53:16

 This question was recently asked at 'Compro Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     linkedlist     Compro Technologies




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 Ashburn are looking for questions for 'Compro technologies'. Connect with them to better prepare for your interview.
X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: