Interview Questions and Answers for 'Polari' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Polari' - 21 question(s) found - Order By Rating

 Q1. How do you achieve String immutability ?Core Java
 This question was recently asked at 'Polaris'.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          Asked in 1 Companies


 Q2. Explain memory leaks and how to prevent them.
 This question was recently asked at 'Polaris'.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     memory leak     Asked in 1 Companies


 Q3. Difference between JVM, JRE and JDK ?Core Java
Ans. JDK(Java Development kit) = Development Kit comprising of JVM , library and development tools for developers

JRE (Java Run time Environment) - Comprise of JVM and set of libraries

JVM(Java Virtual Machine) = Interpreter which reads the .class file line by line.

When we install JDK, JRE also get installed so we can write,compile and excute our code. Used by developer. Without JDK we can only execute the program using JRE.

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

   Like         Discuss         Correct / Improve     jvm  jre  jdk  jvm vs jre vs jdk     Asked in 4 Companies


 Q4. What is abstraction ?Design
Ans. Abstraction is a process of hiding the implementation details and describing only the functionality to the user.

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

   Like         Discuss         Correct / Improve     bstraction  oops concepts  oops principle     Asked in 22 Companies


 Q5. Will the following code compile ?

final HashMap hm = new HashMap();
hm.put("Ravi", 221);
Core Java
Ans. Yes, it will compile without error. final in this context means that the reference hm cannot be assigned to a new hash map but didn't restrict from changing the state of collection already held by hm.

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

   Like         Discuss         Correct / Improve     final  final variable     Asked in 1 Companies


 Q6. When should we use Abstract classes ?Core Java
Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as inheritance ( extending abstract class ). So they should be used in place of interfaces in case there is some code ( methods ) or object body ( member elements ) that can be reused with inheritance.

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

   Like         Discuss         Correct / Improve     abstract classes     Asked in 1 Companies


Frequently asked in high end product companies. Frequently asked in Deloitte.
  Q7. How is Hashmap internally implemented in Java ?Core Java
Ans. https://medium.com/javarevisited/internal-working-of-hashmap-in-java-97aeac3c7beb#:~:text=HashMap%20internally%20uses%20HashTable%20implementation,the%20entries%20into%20the%20map.

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

   Like         Discuss         Correct / Improve     hashmap  collections  hashmap internal implementation     Asked in 20 Companies      expert        frequent


Basic and Very Frequently asked.
  Q8. What is Polymorphism in Java ?Core Java
Ans. Polymorphism means the condition of occurring in several different forms.

Polymorphism in Java is achieved in two manners

1. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas

2. Dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding.

  Sample Code for overloading

  Sample Code for overriding

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

   Like         Discuss         Correct / Improve     polymorphism  object oriented programming (oops)  oops concepts  oops concepts     Asked in 108 Companies      Basic        frequent

Try 2 Question(s) Test


Frequently asked in Infosys India
  Q9. What is a String Pool ?Core Java
Ans. String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its reference.

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

   Like         Discuss         Correct / Improve     java   oops   string   string class   string pool   heap memory     Asked in 31 Companies      intermediate        frequent

Try 2 Question(s) Test


Very Frequently asked to fresh graduates and less experienced. Favorite question in Walk in drives. Frequently asked in Indian Services companies.
  Q10. Difference between Overloading and Overriding ?Core Java
Ans. Overloading - Similar Signature but different definition , like function overloading.

Overriding - Overriding the Definition of base class in the derived class.

  Sample Code for overloading

  Sample Code for overriding

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

   Like         Discuss         Correct / Improve     java   oops   overloading   overriding   oops concepts   basic interview question   overloading vs overriding     Asked in 86 Companies      basic        frequent

Try 1 Question(s) Test


Frequently asked in CTS ( Based on 2 feedback )
  Q11. What is the difference between comparable and comparator in java.util pkg?Core Java
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members.

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

   Like         Discuss         Correct / Improve     java   java.util   comparable   comparator   collections     Asked in 23 Companies      basic        frequent


Frequently asked in Infosys and HCL Technologies ( Based on 2 feedback )
 Q12. What are different ways of object creation in Java ?Core Java
Ans. Using new operator - new xyzClass()

Using factory methods - xyzFactory.getInstance( )

Using newInstance( ) method - (Class.forName(xyzClass))emp.newInstance( )

By cloning an already available object - (xyzClass)obj1.clone( )

  Sample Code for object initialization using clone

  Sample Code for object initialization using getInstance

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

   Like         Discuss         Correct / Improve     java   oops   object creation   new operator   class.forname   cloning   ebay     Asked in 9 Companies      expert


 Q13. What is Generalization and Specialization in terms of casting ?Core Java
Ans. Generalization or UpCasting is a phenomenon where a sub class is prompted to a super class, and hence becomes more general. Generalization needs widening or up-casting. Specialization or DownCasting is a phenomenon where a super class is narrowed down to a sub class. Specialization needs narrowing or down-casting.

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

   Like         Discuss         Correct / Improve     java   data types   casting  type casting   up casting  type casting   downcasting  type casting   generalization   specialization     Asked in 2 Companies


 Q14. What is a Class ?Core Java
Ans. A class is a blue print or Mold using which individual objects are created. A class can contain fields and methods to describe the behavior of an object.

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

   Like         Discuss         Correct / Improve     java   oops   class   basic interview question     Asked in 1 Companies      basic        frequent


  Q15. What is the use of HashCode in objects ?Core Java
Ans. Hashcode is used for bucketing in Hash implementations like HashMap, HashTable, HashSet etc.

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

   Like         Discuss         Correct / Improve     java   string   hashcode   hash code   string comparison  hashtable     Asked in 17 Companies      basic        frequent


 Q16. What does String intern() method do?Core Java
Ans. intern() method keeps the string in an internal cache that is usually not garbage collected.

Moreover provide reference for scp object for corresponding string object present in heap memory.

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

   Like         Discuss         Correct / Improve     java   string class   string   intern method   garbage collection   advanced     Asked in 2 Companies      expert


  Q17. Can we have null keys in TreeMap ?Core Java
Ans. No, results in exception.

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

   Like         Discuss         Correct / Improve     java   collections   treemap     Asked in 6 Companies      Basic        frequent


Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews.
  Q18. Differences between abstract class and interface ?Core Java
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ).

A class can extend single abstract class whereas it can implement multiple interfaces.

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

   Like         Discuss         Correct / Improve     java   classes   abstract class   interfaces   abstract class vs interface   abstract classes vs interfaces     Asked in 82 Companies      basic        frequent


 Q19. Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
Core Java
Ans. abstract and final

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

   Like         Discuss         Correct / Improve     java   java keywords     Asked in 2 Companies      basic


Frequently asked in face to face interviews.
  Q20. Write a program to print fibonacci series.Core Java
Ans. int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}

for(int x=0; x< count; x++){
System.out.print(fibonacci[x] + " ");
}

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

   Like         Discuss         Correct / Improve     ebay   fibonacci series     Asked in 66 Companies      basic        frequent


 Q21. Why can't we declare a class abstract as well as final ?Core Java
Ans. Abstract means that the class is only meant to be subclassed whereas final means that it cannot be subclassed so both concepts - abstract and final are actually mutually exclusive and hence not permitted together.

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

   Like         Discuss         Correct / Improve     abstract   final   java keywords     Asked in 1 Companies



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: