There are a lot of frequently asked interview questions in Java. But many of these are fairly basic. If you have to excel in core Java and train for the rare and toughest questions you’ve got to take up advanced java courses in Mumbai.
Some of the interview questions are as follows:
Explain the creation of a thread-safe singleton in Java using double-checks locking
Singleton is made with double checked locking. As before Java 5 acts as a broker and it’s been possible to have many instances of Singleton when more than two threads create an instance of Singleton at the same instant. Java 5 made it easy to produce thread-safe Singleton using Enum.
State the differences between Array list And Vector
Array list is not synchronized. Array List is fast as it’s non-synchronized. If an element is inserted into the Array List, it increases its Array size by 50%. Array List does not define the increment size. Array List can only use Iterator for traversing an Array List.
However, Vector is synchronized. Vector is slow as it is thread safe. Vector defaults to doubling size of its array. It defines the increment size. It is the only other class which uses both Enumeration and Iterator.
Differentiate between the Inner Class and Sub Class
It’s a class that is nested within another class. Inner class provides the access rights for the class that is nesting it and it can access all variables and methods defined in the outer class.
Whereas it’s a class that inherits from another class called super class. Sub-class gives access to all public and protected methods and fields of its super class.
Reputed institutes like Coder technologies help you to tackle the toughest questions with ease. They give training that consists of tactics to answer those questions confidently and quickly.
The main objective of most advanced Java courses in Mumbai is to set up a clear concept so that you can think logically to answer a question. No question can be answered by mugging up the content. Your basics should be clear and that is what they focus on the most.