Professional Documents
Culture Documents
Data Types: Keyboard, Such As Letters, Numbers and Symbols
Data Types: Keyboard, Such As Letters, Numbers and Symbols
Data Types: Keyboard, Such As Letters, Numbers and Symbols
Variables come in all shapes and sizes. Some are used to store numbers, some are used to store
text and some are used for much more complicated types of data.
Java streams
A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired
result. ... The features of Java stream are – A stream is not a data structure instead it takes input from the Collections,
Arrays or I/O channels
Conditionals
Java uses boolean variables to evaluate conditions. The boolean values true and false are returned when an
expression is compared or evaluated. For example:
int a = 4;
if (a == 4) {
System.out.println("Ohhh! So a is 4!");
}
Loops in Java
Looping in programming languages is a feature which facilitates the execution of a set of instructions/functions
repeatedly while some condition evaluates to true.
Java provides three ways for executing the loops.
Arrays
An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the
array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the "Hello
Example:
class ArrayDemo {
public static void main(String[] args) {
// declares an array of integers
int[] anArray;