Dockerizing Spring Boot Application

Reading Time: 2 minutesIn my previous post, I mentioned about How to run docker container on your local machine. This post is about the dockerizing backend part of the Nutrition Tracking Application. We will follow these steps: Building Spring Boot project Writing a Dockerfile Building and running docker image Step 1: Building Spring Boot project…

read more

Java 8 Optionals for Null Objects

Reading Time: 2 minutesIn my previous post, I mentioned about refactoring techniques including testing interface for null checks. I have recognized that there is an alternative for it while reading Java 8 in Action: Lambdas, streams, and functional-style programming. Optional Class If there is an object that might contain a null value, we can…

read more

Inner Classes

Reading Time: 1 minuteHi, This post is about Inner Classes, which could be useful when you are learning Lambda Expressions and Functional Programming in Java 8. Member Inner Class They can access private variables of outer class. public class MemberInnerClass { private int outer = 5; class Inner { private int inner =…

read more

Class Initialization

Reading Time: 2 minutesToday, I will briefly mention about the class initialization. When we execute any java program (e.g.: java InitTest), Java Virtual Machine loads and link the class, execute initializers, and invokes the main class. Initialization process has some rules. Before we go into the details, spend a few minutes to figure out the output. class…

read more

Core Java APIs

Reading Time: 4 minutesHi, In this post, I will cover a some of the Core Java APIs (String, StringBuilder, Wrapper classes, and Date Time API) that we are responsible for Java 8 Programmer I exam. Immutability I think the first thing that we need to know is immutability. String class is immutable, meaning…

read more

Java Exceptions

Reading Time: 2 minutesHi, This section is about exception handling in Java. I will try to cover as much use cases as I can. The best way to learn exceptions is to play with different exception types, especially handling multiple exceptions, by yourself. We are responsible for following specific classes for Java 8…

read more

Numeric Promotion

Reading Time: 2 minutesHi all, In this post, we will cover numeric promotion in Java. Make sure that you know the bit-length of each primitive types before you proceed. 8-bit 16-bit 32-bit 64-bit byte short, char int, float long, double Assume that you add, subtract, multiple, or divide two primitive types. Should you…

read more

Java Building Blocks

Reading Time: 1 minuteHi, My first blog post is about OCA Java 8 Programmer I certification. I am going to post my notes chapter by chapter. Here is quick introduction.. Packages java.lang package is imported by default. Java primitive types There are 8 primitive types in Java: boolean, byte, short, int , long,…

read more