Author: Awais Farooq

  • Java While Loop

    The Java while loop is used to iterate a part of the program repeatedly until the specified Boolean condition is true. As soon as the Boolean condition becomes false, the loop automatically stops. The while loop is considered as a repeating if statement. If the number of iteration is not fixed, it is recommended to use the while loop. Syntax: The…

  • Loops in Java

    The Java for loop is used to iterate a part of the program several times. If the number of iteration is fixed, it is recommended to use for loop. There are three types of for loops in Java. Java Simple for Loop A simple for loop is the same as C/C++. We can initialize the variable, check condition and increment/decrement…

  • Java Switch Statement

    The Java switch statement executes one statement from multiple conditions. It is like if-else-if ladder statement. The switch statement works with byte, short, int, long, enum types, String and some wrapper types like Byte, Short, Int, and Long. Since Java 7, you can use strings in the switch statement. In other words, the switch statement tests the equality of a variable…

  • Java If-else Statement

    The Java if statement is used to test the condition. It checks boolean condition: true or false. There are various types of if statement in Java. Java if Statement The Java if statement tests the condition. It executes the if block if condition is true. Syntax: Example: Output: Java if-else Statement The Java if-else statement also tests the condition. It executes the if block if condition is…

  • Java Control Statements | Control Flow in Java

    Java compiler executes the code from top to bottom. The statements in the code are executed according to the order in which they appear. However, Java provides statements that can be used to control the flow of Java code. Such statements are called control flow statements. It is one of the fundamental features of Java, which provides…

  • Java Keywords

    Java keywords are also known as reserved words. Keywords are particular words that act as a key to a code. These are predefined words by Java so they cannot be used as a variable or object name or class name. List of Java Keywords A list of Java keywords or reserved words are given below:

  • Operators in Java

    Operator in Java is a symbol that is used to perform operations. For example: +, -, *, / etc. There are many types of operators in Java which are given below: Java Operator Precedence Operator Type Category Precedence Unary postfix expr++ expr– prefix ++expr –expr +expr -expr ~ ! Arithmetic multiplicative * / % additive + – Shift shift << >> >>> Relational…

  • Unicode System

    Unicode is a universal international standard character encoding that is capable of representing most of the world’s written languages. Why java uses Unicode System? Before Unicode, there were many language standards: ASCII (American Standard Code for Information Interchange) for the United States.ISO 8859-1 for Western European Language.KOI-8 for Russian.GB18030 and BIG-5 for chinese, and so on. Problem This caused…

  • Data Types in Java

    Data types specify the different sizes and values that can be stored in the variable. There are two types of data types in Java: Java Primitive Data Types In Java language, primitive data types are the building blocks of data manipulation. These are the most basic data types available in Java language. Java is a statically-typed…

  • Java Variables

    A variable is a container which holds the value while the Java program is executed. A variable is assigned with a data type. Variable is a name of memory location. There are three types of variables in java: local, instance and static. There are two types of data types in Java: primitive and non-primitive. Variable A variable is…