reading-notes

Arrays, Loops, Imports

Packages and Import

Packages

Imports

To import a package within your program you can use one or more of these syntaxes:

import java.util.*; // using the * character to specify the use of all classes within the package.

import java.util.Random; // is used to grab the random class with the util package only.

int seconds =  LocalDateTime.now().getSeconds(); // using the class name without importing.

important note :

Loops

Looping is the feature which allows to execute a certain block of code multiple times with certain controlling set of instructions.

Java provides different types of loops :