Programming in Java language

Programming language Java:

Lexical elements

Lexical elements are numeric, string constants and comments in the code.



Types and variables

Types and variables are closely related because variables are the most important elements of our program in which we store data, partial results of our calculations. Types tell us what data can be stored in variables.



Program structure

Statements Statements are one step in the program.

Expressions Expressions are such a part of the program that performs some operation and then returns t...

Operators

Operators perform an operation between the operands, this operation can be mathematical, logical, or bitwise.



Statements

Statements are important elements for writing programs. Generally one statement line corresponds to one line program. The main group of the statements are: cycles, program branching and flow control.



Java i = x * 5 ; while ( i > 0 ) if ( i == 10 ) break ; else { i --; }

Examples - Java

Java a1 = false && false ; // a1 = false a2 = false && true ; // a2 = false a3 = true && false ; // a3 = false a4 = true && true ; // a4 = true Java ~ i ~ 0xabcd ~( i & 4 )

Java Other pieces of example codes: if ( i == 10 ) break ; else { i --; } ~ 2 70 / 8 x = 1.234 ( float ) i xmin = - 32768 Other pieces of example codes:

The most important commands from Java programming language in one place, a unique comparison and each command-operator is shown using a piece of program. Statements-operators of these sample programs are clickable, so with a simple click we have more information available.