Introduction An exception represents an error condition that can occur during the normal course of program execution. When an exception occurs, it is said to be thrown. When it is thrown, the normal flow of the program terminates and the exception handling block will be executed. The execution handling block is the catch block. This …
Author Archives: Jake Castle
Multithreading in Java
What is a thread? It is a unit of a process. Example:Let use take a scenario where multiplying an array of a thousand numbers with 2. If each operation takes 1 second, it would take a 1000 seconds to complete the whole task. With the help of threads, we can cut the time significantly. Threads …
Interview Questions Part 2
Whats a status code? A status code is a part of the result of an http request that contains a 3-digit integer where the first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. Why String class is immutable in Java?[Good] String class is …
Interview Questions Part 1
Can you give me an example of method overriding? Method overriding occurs when a method is inherited from a parent class but the programmer changes its behavior to something else. An animal class has the method eat(). A dog class extending the animal class and will inherit the method eat(). But the dog however will …
Service Module
Used for duplication of code The same code can be used in multiple components Providing data If certain data in a component needs to be accessed Should NOT create services manually. By that I mean, do not import and create instances of the service to use it. Why? Angular’s Dependency Injector (Hierarchical Injector) Used to …
Databinding in Angular
Definition Databinding = communication Communication between the TypeScript code of your component, business logic & template Using databinding you can output data respond to the user by event biding two-way databinding (respond as well as out output data) String Interpolation Any expression that returns a string Example: {{property}} Property binding [] indicate a property is …
Layout of the Project
App app.module.ts It is a TypeScript file. There is where we tell Angular which pieces belong to our app. Declarations all the components are declared here Imports Provides Bootstrap tells angular which components should be recognized by angular app.component.ts Building an Angular Project Commands to create an Angular projec sudo install -g @angular/cli Installs the …
Angular Introduction
Has a component-based structure Ease of reuse Ability of modularity Allows you to create a Single Page Applications Uses TypeScript which uses strong typing. Benefits of typescript Simplicity Angular Source code (Pattern of writing code) Components in Angular A component in Angular is used to render a portion of HTML and provide functionality to that …
Spring Data JPA
It is one of the projects from the spring.io/projects. It reduces writing a lot of the boilerplate code. What does it do? Creates a DAO (Data Access object). DAO is a design pattern. A DAO is an object that provides an abstract interface to some type of database. By mapping application calls to the persistence layer …
Spring YAML Configuration
YAML is used for configuring different profiles for a simple Spring Boot application. Spring YML file Spring profiles help enable Spring Applications to define different properties for different environments. The three dashes separating the two profiles indicate the start of a new document so all the profiles can be described in the same YAML file. …