Java switch statement

switch statement takes a value, tests if it matches any of the given expressions in the switch block, and executes the corresponding statements. Examples later in this lesson will make it clearer how switch statement works in Java but first, here is syntax for writing switch statement: switch statement syntax

Types of data a switch …

Java switch statement Read More »

Operators in Java

Java Operators: There are different types of operations you can perform in Java, including mathematical operations like addition of numbers, comparisons, logical operations, etc. Operators are basically symbols or character used to carry out different operations in Java programming. In this lesson, we look at different operators available in Java and what they are used …

Operators in Java Read More »

Java Data Types

When you declare a variable in Java, you must state the type of data it is. In other words, you must state the type of data the variable holds. Here is an example:

The example is saying that  favouriteNumber is an integer number (represented with keyword “int”) and  name is a string. In a program like Python, you can declare a variable without …

Java Data Types Read More »