An array is a collection of elements of same data type Primitive or Object type. Each element has a position number called an Index. The size of an array is simply the number of elements of that array. Let us learn Java arrays and multidimensional arrays in detail.
last minute java
A CONTINUE statement inside a loop or iteration in Java causes the program control to go to the beginning of the loop. Next iteration of the loop continues as usual. A CONTINUE statement can be used only with Loops. If you use, you get the error "continue cannot be used outside of a loop".
There are two types of CONTINUE statements.
A BREAK statement in Java causes the program control to exit the block or loop immediately.
A Java Label is any valid Identifier or name with a COLON after it.
Rules to define a Label
- A Label name must start with either Alphabet, Number, Underscore(_) or a Dollar ($) symbol.
- A Label must be followed by a Loop or a Block.
- Defining a Label like a Goto statement produces a compiler error
There are two types of Break statements.
Java language provides a Do While loop with slightly modified features of the WHILE loop.
Normal WHILE loop does not execute loop statements if the condition is not satisfied or true. But a DO WHILE loop executes the loop statements for the first time without even checking the loop condition. Programmers usually prefer a WHILE loop to DO WHILE loop.
Java language has a special operator called Ternary Operator that works like a Shortcut IF ELSE control statement.
Java Ternary Operator (?:) Explained
Java Ternary Operator (?:) or Question Mark Colon Operator tests a condition and moves the control to two branching points, one for true and one for false.