- •Pointers
- •Procedural programming
- •Object oriented programming
- •3) The basic paradigms of object-oriented programming: encapsulation, polymorphism and inheritance.
- •Identifier or function name
- •7) String functions in the programming language Java.
- •8.Loops and branching statements in the programming language Java
- •The break Statement
- •The return Statement
- •11) Creation and using one-dimensional and multi-dimensional arrays in the programming language Java.
- •13) Working with I / o system in the programming language Java
- •17) Classification of data types in the programming language Java.
- •18) Java Object Model.
- •1. Java Distributed Object Model
- •1.1 Basic Concepts of the Java Object Model
- •1.2 Basic Concepts of the Java Distributed Object Model
- •1.3 Objects
- •19) Generics in the programming language Java.
- •Example
- •Rules in function overloading
- •Pointer Variables (or Pointers)
- •Declaring Pointers
- •30) Dynamic memory allocation operations: new and delete.
- •Operators new and new[]
- •Operators delete and delete[]
8.Loops and branching statements in the programming language Java
Looping statements in java enables us to execute blocks of statements repeatedly. The JAVA programming language supports three type of loop constructs: · for loop · Do-while loop · while loop The "for" and "while" loop tests the condition statement before executing the loop body. This implies that for and while loops might not execute the loop body even once, whereas do loops execute the loop body at least once.
for loop -A for loop is an "entry controlled" loop i.e. it will test the condition before entering in the loop body. The statements within the loop will be getting executed at least once if and only if the condition is true otherwise; the following loop statements will be getting executed. The for loop syntax is: For (; ; ) We can also use an enhanced for loop instead of the regular for loop that enables us to iterate over the complete array without giving its length or size. The syntax of enhanced for loop is: for (datatype variable/element : array name)
while loop A while loop is an "entry controlled" loop. This loop will check the condition before entering in the loop. The statements within the loop will be getting executed at least once if and only if the condition is true otherwise; the following loop statements will be getting executed. The syntax for while loop is: while () Ensure that the loop-control variable is initialized appropriately before the loop body begins execution. You must update the control variable appropriately to prevent an infinite loop. Do-while loop The do/while loop is an "exit controlled" loop. This loop will test the condition at the exit of the loop statements. So at least once the statements will be get executed and, after once the condition will be checked. If than the condition is satisfied the loop will continue otherwise, the following statements will be get executed. The syntax for do/while loop is: do
< statement_or_block >
while (As with the while loops, ensure that the loop-control variable is initialized appropriately, update in the body of the loop, and tested properly. We use the 'for' loop in the cases where the loop is to be predetermined number of times. We use the while and do loops in cases where this is not determined beforehand. Branching Statements The Java programming language supports three branching statements:
The break statement
The continue statement
The return statement
