In Java, the Comparable and Comparator interfaces are used to sort collections of objects based on certain criteria. The Comparable interface is used to define… Read More
Tag Archives: java-interfaces
The Comparable interface is used to compare an object of the same class with an instance of that class, it provides ordering of data for… Read More
Interface in java is used to achieve abstraction. It is also considered as the blueprint for the class. An interface can contain abstract methods only… Read More
ReadWriteLock is an interface in java. A ReadWriteLock allows us to add a thread-safety feature to a data structure while increasing throughput by allowing multiple… Read More
Interfaces in Java consist of abstract methods (which do not contain a body) and variables (which are public static final). Implementation of the methods of… Read More
In Java, an interface is a reference type similar to a class that can contain only constants, the method signatures, default methods, and static methods,… Read More
In Java there is no concept of multiple-inheritance, but with the help of interface we can achieve multiple-inheritance. An interface is a named collection of… Read More
Java language is one of the most popular languages among all programming languages. There are several advantages of using the java programming language, whether for… Read More
Maintenance is one of the important aspects of software development, and experience has shown that software that maintains its component’s visibility low is more maintainable… Read More
java.lang.Runnable is an interface that is to be implemented by a class whose instances are intended to be executed by a thread. There are two… Read More
Interface contains only abstract methods that can’t be instantiated and it is declared by keyword interface. A class that is declared with the abstract keyword… Read More
In Java, the interface is called a blueprint of a class and it is used to achieve abstraction in java. By using interfaces only we… Read More
Generics make a class, interface and, method, consider all (reference) types that are given dynamically as parameters. This ensures type safety. Generic class parameters are… Read More
A lock is a device for commanding access to an assigned resource by multiple threads. Usually, a lock grants exclusive access to a shared resource:… Read More
A Closeable is a source or destination of the data that needs to be closed. The close() method is invoked when we need to release… Read More