Fidelity – Java Interview Questions
Here is the list Java Interview Questions which are recently asked in Fidelity company. These questions are included for both Freshers and Experienced professionals.
1. Define a Java Class.
A class is a user defined blueprint or prototype from which objects are created. It represents the set of properties or methods that are common to all objects of one type. Modifiers: A class can be public or has default access. Class keyword: class keyword is used to create a class.
2. What is an object in Java and how is it created?
In Java, the new keyword is used to create new objects. A variable declaration is done with a variable name with an object type. Instantiation − The 'new' keyword is used to create the object. Initialization − The 'new' keyword is followed by a call to a constructor.
3. What is Object Oriented Programming?
Object-oriented programming is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.
4. What are the main concepts of OOPs in Java?
The four main concepts of OOP in Java are abstraction, encapsulation, inheritance, and polymorphism.
5. What is the difference between a local variable and an instance variable?
The main difference between instance variable and local variable is that instance variable is a variable that is declared in a class but outside a method, while a local variable is a variable declared within a method or a constructor. Moreover, a variable is a memory location to store data in these programs.
6. What is final keyword in Java?
The final keyword can be used while declaring an entity. using the final keyword means that the value can't be modified in the future. this entity can be - but is not limited to - a variable, a class or a method.
7. What is an infinite loop in Java? Explain with an example.
An infinite loop occurs when a condition always evaluates to true. Usually, this is an error. For example, you might have a loop that decrements until it reaches 0. public void sillyLoop( int i ) { while ( i != 0 ) { i-- ; } }
Free PDF : Get our updated Java Course Content pdf
8. What is the difference between this() and super() in Java?
super() as well as this() both are used to make constructor calls. super() is used to call Base class's constructor(i.e, Parent's class) while this() is used to call current class's constructor.
9. What is Java String Pool?
String pool is nothing but a storage area in Java heap where string literals stores. It is also known as String Intern Pool or String Constant Pool. It is just like object allocation. By default, it is empty and privately maintained by the Java String class.
10. What is constructor chaining in Java?
Constructor chaining is the process of calling one constructor from another constructor with respect to current object. It can be done using this() keyword for constructors in same class.
11. What is a classloader in Java?
A class loader is an object that is responsible for loading classes. The class ClassLoader is an abstract class. Given the binary name of a class, a class loader should attempt to locate or generate data that constitutes a definition for the class.
12. What is the difference between an array and an array list?
An array is basic functionality provided by Java. ArrayList is part of collection framework in Java. Therefore array members are accessed using [], while ArrayList has a set of methods to access elements and modify them. Array is a fixed size data structure while ArrayList is not.
13. What is a Map in Java?
An object that maps keys to values and a map cannot contain duplicate keys; each key can map to at most one value. The Map interface provides three collection views, which allow a map's contents to be viewed as a set of keys, collection of values, or set of key-value mappings.
Get Answer for all the above questions and place in your dream company
Wants to Become an Expert
in Java?
Know MoreTOP MNC's JAVA INTERVIEW QUESTIONS & ANSWERS
Here we listed all Java Interview Questions and Answers which are asked in Top MNCs. Periodically we update this page with recently asked Questions, please do visit our page often and be updated in Java.