Sunday, May 12, 2024

Collection Framework Interview questions

 I have went through many interviews on java and the main topic in focus is Java collection framework.

All the below questions are asked in the interview to me and I will also add more after each interview. so it will not only benefit me for interview preparation but also helpful for others.


Q1. What is the difference in Collection and Collections?

Q2, What is immutable class?

Q3. What is the difference between HashMap and Concurrent HashMap?

Q4. What is the use of static keyword?

Q5. (class- inheritance)What error we will get for below code?

            interface Vehicle{

                    void brake();

            }

             public Class Car{

             public static void main(String[] args){

            Vehicle v = new Car();

                brake();

                }

               public void brake(){System.out.println("Car will stop");

                }

              }


Q6. What are the classes in the collection framework?

Q7. What is the difference between Set and List?

No comments:

Post a Comment

Linux OS - SSH configuration

 SSH connection using Putty: 1. sudo apt-get update 2. sudo apt-get upgrade 3. sudo apt remove openssh-server 4. sudo apt install openssh-se...