Skip to main content

Collection Interview Question || Top 10 interview Question in collection topic in java

                        Collection Interview Question

 The collection is a very important topic in the interview. interviewer asking so many questions about the collection. when I am giving interviews asking related to the topic. so I am referring to you please start questing about the collection topic.
In this section, I am collecting lots of topmost important questions related to the collection topic.


  • Why collection is important?                                                                                                          - > The collection is a framework it is not a concept the real use of collectin is available so that interview asking so many times about the collection in java. we can take any project collection is available. without collection, you can't do java project.    that's why the collection is a very important topic in java.
  •   What is the use of collection?                                                                                                             ->The collection is used to store homogenous, Heterogeneous, unique, and duplicates values. It means that you have used this collection in your program to store the object and pass this object in other modules and package classes. so finally we can say that collection is used to pass the object in one class to another class easily.  

  • Some Very important Question in Collection?  

      1. What are Collection related features in Java 8?


      2. What is the Java Collections Framework? List out some benefits of the Collections framework?

      3. What is the benefit of Generics in the Collections Framework?

      4. What are the basic interfaces of the Java Collections Framework?

       5. Why Collection doesn’t extend Cloneable and Serializable interfaces?

       6. Why Map interface doesn’t extend Collection interface?

       7. What is an Iterator?

        8. What is the difference between Enumeration and Iterator interface?

       9. Why there is no method like Iterator.add() to add elements to the collection?

     10. Why Iterator doesn’t have a method to get the next element directly without moving the cursor?

       11. Can we use any class as Map key?

      12. What are the different Collection views provided by Map interface?

       13. What is the difference between HashMap and Hashtable?

       14. How to decide between HashMap and TreeMap?

     15. What are the similarities and differences between ArrayList and Vector?

      16. What is the difference between Array and ArrayList? When will you use Array over                            ArrayList?

       17. What is the difference between ArrayList and LinkedList?

       18. Which collection classes provide random access to its elements?

        19. What is EnumSet?

       20. Which collection classes are thread-safe?

       21. What are concurrent Collection Classes?  

  • What is memory digram of ArrayList Object?   
     It is the internal memory digram of collection framework like ArrayList Class If you see this in this section you find how to Student objects are store in ArrayList and pass this object to other classes. ArrayList is implemented by List interface so that its behavior is storing the heterogeneous type of data stored in the program.
Memory Diagram Of collection in java
 
 
  • What is the ArrayList and  LinkedList?
       It is very important concept in java. If you want to learn java then don't forget to learn. Because the collection is very important for everyone.
ArrayList class




HashMap and LinkedHashMap

Comments

Popular posts from this blog

#Logic How to convert String Characters lower to upper and upper to low...

How to convert String Characters.  lower to upper and upper to lower How to Convert all the String character Upper and lower . If String character is lower than convert Upper If it is Upper than you have to convert a lower. I am going to introduce it is a very simple and easy way. String Conversion is very easy through the toUpperCase() and toLowerCase(); Method But I am going to do this Question without using the Inbuilt method in the class. You have to do this Only For logical coding Question. So, Finally, I am going to do this Question step-by-step if you want to watch videos than you can watch. In these videos, I discuss this question in a very simple and easy way. You have to take one class with the main method.                class Test{                 public static void main(){                    //your logic ...

Top 97 logical coding Question | for Freshers for getting a job in MNC Company | by er prince kumar

            Top 97 logical coding Question  for Freshers  If you do this you will become good logical programmers Write a Java program to perform input/output of all basic data types. Write a Java program to enter two numbers and find their sum. Write a Java program to enter two numbers and perform all arithmetic operations. Write a Java program to enter the length and breadth of a rectangle and find its perimeter. Write a Java program to enter the length and breadth of a rectangle and find its area. Write a Java program to enter the radius of a circle and find its diameter, circumference, and area. Write a Java program to enter the length in centimeter and convert it into meter and kilometer. Write a Java program to enter the temperature in Celsius and convert it into Fahrenheit. Write a Java program to enter the temperature in Fahrenheit and convert to Celsius Write a Java program to convert days into years, weeks and days....

Java objective question for written Test | Java written test objective question

                               Java objective question All the best important question ------------------------------------------------------------------------ 1. Answer: Illegal combination of final and abstract class 2. Answer: 4 3. Answer:    error: bad operand types for binary operator '=='                 System.out.println("Helo"+10==10); 4. Answer:   error: integer number too large                 System.out.println(08); Q5. ====  class Nit { public static void main(String[] args) { m1(2); } public static void m1(int i) { if (i >= 0) { m1(i - 1); } System.out.println(" " + i); }} output:  -1  0  1  2 ================================== Q.2 ------ ...