Skip to main content

Interoduction

Interfaces

Definition 1: Any service requirement specification (SRS) is considered an interface.

Example 1:
A JDBC API specifies the requirements needed to develop a database driver. The database vendor is responsible for implementing this JDBC API.

Example 2:
The Servlet API defines the requirements for developing a web server. The web server vendor is responsible for implementing the Servlet API.

Definition 2: From the client's point of view, an interface defines the set of services they expect.
From the service provider's point of view, an interface defines the set of services they offer. Therefore, any contract between a client and service provider can be considered an interface.

Example:
The bank ATM GUI screen highlights the set of services offered by the bank. At the same time, it represents the set of services the customer is accepting. Hence, this GUI screen acts as a contract between the customer and the bank.

Definition 3: Inside an interface, every method is always abstract, whether declared or not. Thus, an interface is considered a 100% pure abstract class.

Summary Definition: Any service requirement specification, any contract between a client and service provider, or any 100% pure abstract class is considered an interface.

Popular posts from this blog

Java

Codes With Java — Basics Codes With Java Java tutorials & fundamentals About Contact Privacy Basic Fundamentals Java source file structure Import Statement Static Import Packages Data Type Variables Final Variable Declaration and Access Modifier Inner classes applicable modifiers Static Modifier Synchronized Native Transient Volatile Interface Introduction Interface Declaration and Implementation Interface methods and variables Naming Conflicts Interface Marker interface and Ad...

Short Circuite Operators part 4

                                                             Short Circuit Operators In  Java logical operators , if the evaluation of a logical expression exits in between before complete evaluation, then it is known as  Short-circuit . A short circuit happens because the result is clear even before the complete evaluation of the expression, and the result is returned. Short circuit evaluation avoids unnecessary work and leads to efficient processing. 1-: AND(&&) 2-:OR(||) these are exactly same as bitwise operators (&,|) except the following differences. Single Short Circuit Operator(&,|) Both arguments Should be evaluated always. relatively performance is low. Applicable for both boolean and Integral types. Double Short Circuit Operator(...

Operators & Assignment part 3

                                                                                       Operators & Assignment 1-:instanceof Operators 2-:Bitwise Operators                                                                        instanceof Operators we can use instanceof operator to check whether the given object is of a particular type are not. Example-: /* list is a collection of objects. List l=new List(); l.add(Customer); l.add(Student); l.add(Test); Object o=l.get(...