Java Series Part 2: Java Variables

Variables in Java are containers for storing data values. In Java, there are different types of variables, for example: String - stores text, such as "Hello World". String values are surrounded by double quotes int - stores integers (whole numbers), without decimals, such as 15 or -15 float - stores floating point numbers, with decimals, such as 1.99 or -1.99 … Continue reading Java Series Part 2: Java Variables

Java Series Part 1: Java Expressions

A Java expression consists of variables, operators, literals, and method calls. package com.java.basic; public class ExpressionsExample { public static void main(String args[]) { // 5 + 2 is an expression int add = 5 + 2; System.out.println("Addition= " + add); // 5 - 2 is an expression int sub = 5 - 2; System.out.println("Substraction= " + … Continue reading Java Series Part 1: Java Expressions