Infosys
ABC Bearings Interview Questions and Answers
Q1. Difference between where clause and having clause in SQL ?
Where clause filters rows before grouping, having clause filters groups after grouping.
Where clause is used to filter rows based on a condition before grouping.
Having clause is used to filter groups based on a condition after grouping.
Where clause is used with SELECT, UPDATE, DELETE statements.
Having clause is used with SELECT statement and GROUP BY clause.
Where clause cannot contain aggregate functions.
Having clause can contain aggregate functions.
Example: SELECT * FROM tabl...read more
Q2. What is diffrence between Arraylist and vector ?
ArrayList is not synchronized while Vector is synchronized.
ArrayList is faster than Vector as it is not synchronized.
Vector is thread-safe while ArrayList is not.
Vector is a legacy class while ArrayList is not.
Vector can grow by a specified amount while ArrayList grows by 50% of its size.
Example: ArrayList
list = new ArrayList<>(); Vector vector = new Vector<>(); Example: list.add(1); vector.add(1);
Example: list.get(0); vector.get(0);
Q3. What are the legacy classes in java?
Legacy classes in Java are the classes that have been replaced by newer versions but are still supported for backward compatibility.
Legacy classes are part of the Java API and are still supported for backward compatibility.
They have been replaced by newer versions but are still used in older applications.
Examples of legacy classes include Vector, Hashtable, and Enumeration.
Legacy classes are not recommended for use in new applications and should be replaced with newer alterna...read more
Q4. What is autoboxing and auto-unboxing ?
Autoboxing is the automatic conversion of primitive data types to their corresponding object wrapper classes.
Autoboxing allows primitive data types to be used as objects.
Auto-unboxing is the reverse process of autoboxing.
Autoboxing and auto-unboxing are performed automatically by the compiler.
Example: int i = 10; Integer j = i; // autoboxing
Example: Integer j = 10; int i = j; // auto-unboxing
Q5. What is interface in java ?
An interface in Java is a collection of abstract methods and constants that can be implemented by a class.
Interfaces are used to achieve abstraction and provide a way to implement multiple inheritance in Java.
All methods in an interface are abstract by default and cannot have a body.
A class can implement multiple interfaces but can only extend one class.
Interfaces can also have default and static methods with a body.
Example: interface Shape { void draw(); }
Example: class Circ...read more
Q6. What is joins in SQL ?
Joins in SQL are used to combine data from two or more tables based on a related column.
Joins are used to retrieve data from multiple tables in a single query.
There are different types of joins such as inner join, left join, right join, and full outer join.
Inner join returns only the matching rows from both tables, left join returns all rows from the left table and matching rows from the right table, right join returns all rows from the right table and matching rows from the ...read more
Q7. What is sychronization ?
Synchronization is the process of coordinating multiple threads to ensure safe and consistent access to shared resources.
Synchronization is used to prevent race conditions and ensure thread safety.
It can be achieved using synchronized blocks or methods.
Synchronization can cause performance issues if not used properly.
Example: Synchronizing access to a shared counter variable in a multi-threaded application.
Q8. What is encapsulation ?
Encapsulation is the process of hiding implementation details and providing access to only necessary information.
Encapsulation is achieved through access modifiers such as public, private, and protected.
It helps in achieving data abstraction and information hiding.
Encapsulation provides better control over the data and prevents unauthorized access.
Example: A class with private variables and public methods to access them.
Example: Java Bean classes that have private variables a...read more
Q9. What is collection framework?
Collection framework is a set of classes and interfaces that provide a way to store and manipulate groups of objects.
It provides interfaces like List, Set, Queue, etc. for storing collections of objects.
It also provides classes like ArrayList, HashSet, PriorityQueue, etc. that implement these interfaces.
It allows easy manipulation of collections using methods like add, remove, contains, etc.
It provides algorithms like sorting and searching that can be used on collections.
Exam...read more
Interview Process at ABC Bearings
Reviews
Interviews
Salaries
Users/Month