Encapsulation in Java is the concept of bundling data (fields) and methods that operate on that data into a single unit, usually a class, and restricting direct access to the internal state of the object. This is typically done by making fields "private"
and providing "public" getter and setter methods. It helps protect the integrity of the data, improves code maintainability, and allows for better control over how the data is accessed or modified.
Overloading happens within the same class when multiple methods have the same name but different parameter lists (different number or types of parameters). It's a way to provide multiple behaviors for a method depending on the input. Overriding occurs in an inheritance relationship when a subclass provides a specific implementation of a method that is already defined in its superclass. The method signature must be exactly the same, and it's used to provide specialized behavior in the subclass.
In short: Overloading = same method name, different parameters; Overriding = same method signature, different class (child overrides parent)."
g individual row deletions and cannot have a WHERE clause; it removes all data. In most databases, TRUNCATE cannot be rolled back once executed.
In summary, DELETE is more flexible and safer for selective row removal, while TRUNCATEis efficient for quickly clearing entire tables."