AbstractSet is a Java Collection Framework class that implements the Collection interface and extends the AbstractCollection class. It implements the Set interface in its most basic form. This class does not override any of the AbstractCollection class’s implementations, but instead adds equals() and hashCode() methods. Class Hierarchy: Syntax: Where E is the type of elements […]
September 12, 2022 | Java | 1 comment
Along with the AbstractMap Class, the TreeMap class in Java is used to implement the Map interface and NavigableMap. Depending on which constructor is used, the map is sorted based on the natural ordering of its keys or by a Comparator specified at map creation time. TreeMap class declaration: where, K: It is the type of […]
August 2, 2022 | Java | No comments
Following are the important differences between an abstract class and a concrete class. Sr. No. Key Abstract Class Concrete Class 1 Supported Methods Both abstract and concrete methods can be found in an abstract class. Only concrete methods are allowed in a concrete class. The class is abstract, even if it only has one abstract […]
June 11, 2022 | Java | No comments
As we all know, abstraction refers to hiding the internal implementation of a feature and only giving the users the functionality. i.e. how it works (showing), what it does (showing) (hiding). Because an abstraction is achieved using both abstract classes and interfaces, Interface and Abstract classes are needed prerequisites. Let’s see the differences between them. […]
June 3, 2022 | Java | No comments
In Java, an interface is a blueprint for a class. It has abstract methods and static constants. In Java, the interface is a means of achieving abstraction. The Java interface can only have abstract methods, no method bodies. In Java, it is used to achieve abstraction as well as multiple inheritance. Java Interface also represents the […]
June 3, 2022 | Java | No comments
In Java, an abstract class is specified with the abstract keyword. Both abstract and non-abstract methods can be used (method with the body).Note: Abstraction is the process of hiding implementation details from the user and only displaying functionality. A class that is declared using the abstract keyword is known as an abstract class. Abstract classes […]
June 3, 2022 | Java | No comments
Non-access modifiers provide the JVM with information about a class, method, or variable’s characteristics. In Java, there are seven different types of Non-Access modifiers: static final abstract synchronized volatile transient native Static: The static keyword indicates that the entity to which it is applied is accessible from any instance of the class. The static keyword […]
May 17, 2022 | Java | No comments