Category java

Introduction to Java Annotations

What are Annotations? Categories of Annotations Marker Annotations Single Value Annotations Full Annotations Type Annotations Repeating Annotations Predefined/Standard Annotations @Deprecated @Override @SuppressWarnings @Documented @Target @Inherited User-Defined (Custom)

Building REST APIs in Java using Spring Boot

What is Spring Boot and what is the advantage of using Spring? Spring Boot is a Framework from “The Spring Team” to ease the bootstrapping and developmentof new Spring Applications. It provides defaults for code and annotation configuration to quick…

Introduction to REST API

Overview Why Web Service? This problem can be solved easily using web service. The bank B2 will provide a webservice and using it any other bank’s ATM can access their customer’s information. How is an API being different from a…

Networking in Java

Overview Java Networking Java Networking Terminology IP Address Protocol Port Number MAC Address Connection-oriented and Connection-less Protocol Socket java.net Package

Lambda Expressions and Functional Interface

Lambda expressions was added to Java by JDK 8.  Introducing Lambda Expressions Key to understanding Java’s implementation of lambda expressions are two constructs. The first is the lambda expression, itself. The second is the functional interface. Let’s begin with a simple definition of each.  A lambda expression is,…

Generics

Generic Fundamentals A Simple Generic Example Bounded Types Sometimes it is useful to limit the types that can be passed to a type parameter. For example, assume that you want to create a generic class that contains a method that returns the average of an…

Polymorphism

Overview Why Override Methods? Using Abstract Methods There are situations in which you will want to define a superclass that declares the structure of a given abstraction without providing a complete implementation of every method. That is, sometimes you will want to…

Encapsulation and Access Modifiers

Controlling Access to Class Members Modifier Class Package Subclass World public Y Y Y Y protected Y Y Y N no modifier Y Y N N private Y N N N Tips on Choosing an Access Level Encapsulation Properly encapsulated…