Articles

Java Enhanced For Loop With Custom Types

By: Stephen Patrick | 30 Jun 2016 | Category: Java Constructs

Java Enhanced For Loop With Custom Types

The Java enhanced for loop simplifies the process of iterating arrays and collections. But what if you want to use this construct with custom java types. Let's examine how we can perform this task. However, first we need to define some custom java types.

Read More

Java Enhanced For Loop

By: Stephen Patrick | 30 Jun 2016 | Category: Java Constructs

Java Enhanced For Loop

The Java enhanced for loop was introduced in Java 5. The Java enhanced for loop facilitates the iteration of a collection / array without the need to explicitly create a collection in code.

Read More

Java For Loop

By: Stephen Patrick | 26 Jun 2016 | Category: Java Constructs

Java For Loop

The Java for loop allows you to iterate n number of times until a terminating condition is met. The Java for loop is useful when you need to execute a section of code a number of times. The Java language provides a number of loop structures, these include while, do while, for loop and the enhanced for loop.

Read More

Java Do While Loop

By: Stephen Patrick | 26 Jun 2016 | Category: Java Constructs

Java Do While Loop

Java also provides a Do While loop construct that is similar to a while loop. However, this construct has one important difference. The condition is no longer triggered before entering the loop but instead the condition is evaluated at the end of the loop.

Read More

Java While Loop

By: Stephen Patrick | 26 Jun 2016 | Category: Java Constructs

Java While Loop

The Java while loop will continue to execute a block of code while a condition is true. The while statement takes a boolean expression. If the boolean expression evaluates to true, the while loop will continue to execute. If the boolean expression evaluates to false the while loop will cease executing.

Read More

Java Switch Statement

By: Stephen Patrick | 25 Jun 2016 | Category: Java Constructs

Java Switch Statement

The java switch statement is similar in a way to the Java if .. else if .. else statement. A java switch statement allows a value to be tested for equality.

Read More

Java Ternary Operator

By: Stephen Patrick | 25 Jun 2016 | Category: Java Constructs

Java Ternary Operator

The java ternary operator adds syntactic sugar to the java if else clause. However, it is slightly different to your typical if / else clause. The ternary operator is specifically used to assign the result of a condition to a variable.

Read More

Java If Statement

By: Stephen Patrick | 25 Jun 2016 | Category: Java Constructs

Java If Statement

Java programs are normally written sequentially, as a sequence of statements. Moreover, these statements are normally executed one after the other in the order in which they are defined. However, sometimes we want to alter the order of execution by making a decision, a selection.

Read More

Java Code Blocks

By: Stephen Patrick | 25 Jun 2016 | Category: Java Constructs

Java Code Blocks

Java statements and java expressions appear inside of code blocks. A code block is simply code that is enclosed within { and } characters or as the are commonly know in java left and right curly braces. When we write java programs that code we write is enclosed within a code block. We we create a java class the code that defines the class is enclosed within a code block.

Read More

Java Statements

By: Stephen Patrick | 24 Jun 2016 | Category: Java Constructs

Java Statements

A statement in Java can be considered as a line of code that adheres to the rules of java language and is a unit of execution. A java statement can be considered as a sentence in natural language in that it follows the rules of the language.

Read More

Java Expressions

By: Stephen Patrick | 24 Jun 2016 | Category: Java Constructs

Java Expressions

Java expressions are pieces of code that are evaluated to produce a result. Expression can consist of variables, operators and method calls and must adhere to the rules of the java language. For example assigning a variable in java is an expression.

Read More

Spring REST Introduction

By: Stephen Patrick | 24 Jun 2016 | Category: Spring REST

Spring REST Introduction

REST stands for Representational State Transfer and is an architectural style used for building web applications that is based on the technology of the Web. At the core of REST is the concept of a resource. We will build a very simple REST Service using the Spring Framework and Spring Boot. Spring Boot aims to simplify development with the Spring Framework. The first thing we need to do is configure Spring Boot.

Read More

Go Work Environment

By: Stephen Patrick | 16 Jun 2016 | Category: Go Introduction

Go Work Environment

When working with Go we need to follow certain conventions. When we work with Go code we normally don't work in isolation. We reuse existing libraries. When we are writing Go programs we must follow a directory naming structure.

Read More

JAX-RS Introduction

By: Stephen Patrick | 13 Jun 2016 | Category: JAX-RS Rest Web Services

JAX-RS Introduction

Rest stands for Representational State Transfer and is an architectural style used for building web applications that is based on the technology of the Web. At the core of Rest is the concept of a resource. In general a resource is anything that can be accessed or manipulated in some way. Examples of resources could be representations of servers in a cloud hosting environment, images etc.

Read More

Go Installation Linux

By: Stephen Patrick | 08 Jun 2016 | Category: Go Introduction

Go Installation Linux

Go can be installed on Linux. To install Go on Linux go to https://golang.org/dl/ and download the latest installation. For example for Linux 64 bit go1.6.2.linux-amd64.tar.gz.

Read More

How To Disable Tests With Maven

By: Stephen Patrick | 08 Jun 2016 | Category: Maven

How To Disable Tests With Maven

As mentioned, maven is a java build and dependency management tool. As part of the build and packaging process Maven can run execute your Junit Tests. However, this behavior can be disabled

Read More

XML Well Formed

By: Stephen Patrick | 03 Jun 2016 | Category: XML Introduction

XML Well Formed

XML is an eXtensible markup language. We will talk about the different components that make up an XML document and what it means for an XML document to be well formed. XML enhances text with semantics in other words XML gives meaning to text. XML defines strict syntactic rules for what constitutes a well-formed XML Document. Lets consider what makes an XML document well formed.

Read More

XML Whitespace

By: Stephen Patrick | 03 Jun 2016 | Category: XML Introduction

XML Whitespace

XML documents contain two types of white spaces namely Significant Whitespace and Insignificant Whitespace. It is important to have an understanding of how white space works within XML documents as there can be some subtleties when you’re working with a variety of XML technologies. XML significant whitespace is whitespace that cannot be easily ignored. This category of whitespace occurs within elements such as within the elements text content or it can occur in mixed content, elements and text mixed together. This text will get passed to the application exactly as is.

Read More

XML Comments

By: Stephen Patrick | 03 Jun 2016 | Category: XML Introduction

XML Comments

XML allows you to place comments within an XML document. As with any programming language, comments allow you to provide some extra information that describes the content.
XML comments have no special processing.

Read More

XML Processing Instructions

By: Stephen Patrick | 03 Jun 2016 | Category: XML Introduction

XML Processing Instructions

XML processing instructions are added to a document to provide special information to the application processing an XML document. You have probably already seen an XML processing instruction even if you did not realize it.

Read More

Popular Articles