Skip to main content

Java Collection Framework Most Important Questions


 

Q:-1   What is Collection Framework ?
A:-     Collection framework is a unified architecture or predefined java classes and interfaces that is used for implementing  a group
         of objects in java.

Q:-2   What is Collection ?
A:-     A collection represents a group of objects. And it is root interface of java collection hierarchy.

Q:-3   What is Collections ?
A:-     Collections is a utility class in java which is present is java.util package for manipulating  data. It provides static method for   
         searching, sorting and more.

Q:-4   What is difference between Array and Collection ?
A:-

 
 1>     Array is a object in java which                    Collection is a interface which contains    
           contains similar data elements.                   methods for implementing classes and basic
                                                                             operations.

 2>    It contains elements in a specified              It  is growable in nature so it can be increase its
          limit.                                                            size when required.    

 3>    Array is best suitable when data is             Collection is best suitable when data size is unknown.
         fixed in size.                  

 4>    Array can contain same type of data.          Collection can contain different types of data.

 5>    It doesn't provides basic operations            It provides basic data operation methods like
         method support.                                          add, addAll, remove and more.
                                                                                                                                                                                                                                                                                                                                                           
 
Q:-5   What is List ?
A:-     List is a child interface of collection interface. List interface is implemented by using dynamic                 array data structures. It can contains duplicate data.    


Q:-6   What is Set ?
A:-     Set is a child interface of collection interface. Set interface is best suitable when duplicate
          data not required.


Q:-7   What is Queue ?
A:-      Queue is child interface of collection interface. Queue interface is best when data processing 
          is required in prior to processing. It follows FIFO order i,e First in First Out order.


Q:8    What is ArrayList ?
A:-     ArrayList is a class in java. That implements List interface. It provides random access of data                   elements. we can access elements from ArrayList like an array.


Q:9    What is LinkedList ?
A:-     LinkedList is a java class that implements List interface. Data stored in linkedList of the form
           of node. Data insertion operations are fast in linkedList.


Q:10   What is Vector ?
A:-      Vector in java is a class which implements List interface. It is also known as legacy class 
           because it present in java from java 1.0 V. It uses dynamic array. It is same as arrayList 
           except, arrayList is non-synchronized and vector is synchronized.         



        










                                             


   











Comments

Popular posts from this blog

most importent core java interview questions and answers

   Most Important Core  Java Interview Questions &  Answers for fresher and experience both 1. What is java? A. java is object oriented programing language which is invented by james gosling in 1995. first version of java is called oak but after that its name was changed with java. 2. What are the features of java? A. There are some features of java :    (a) Platform independent.   (b) Object Oriented Programming Language.   (c) Strongly-typed Programming Language.   (d) Interpreted and Compiled Language.   (e) Automatic Memory Management. 3.What is mean by  Platform independent ? A. Java is plateform independent because java uses JVM ( java virtual machine for run the      bytecode wich is generated by java compiler ) and JVM is plateform dependent so every     java code after compilation it ganerates bytecode wich is pateform independ...

Core java collection framework interview questions and answers second part...

                                            1: which classes of collection framework that takes only homogeneous (same type) objects only. Ans: Only there are two classes that takes homogeneous elements those are TreeSet and TreeMap.                                                   2: How ArrayList work's internally? Ans:             Example :       ArrayList :     | 1 | 5 | 6 | 9 | 4 | 5 | 2 | 11 |      Size : 8      index : 0 - 7 arraylist is same as an array but it's dynamic array so, it increases it's size when required.    when you create a arraylist object initially it's size will be 10, and as you inter any value that  will go in in in...

Java Inheritance

#Java Inheritance Interview Questions      #inheritance | #multilelelinheritance | #single inheritance | #javainheritance | #oppsinheritance |     #java  | #OOps | #corejava | #corejavainheritance | #java inheritance | #coreinheritance |   #oopjavainheritance   1: What is inheritance?   A: Inheritance is the most important feature in any object-oriented programming language, This is a                child-parent relationship that allows as to reuse the same logic or same code in a specific manner.   2: How many types of inheritance are supported by java? A:  4 types of inheritance are supported by java,           Single-Level, Multi-Level, Hierarchical, Multiple. Note: In java multiple inheritance, we can achive through Interface.                                   ...