Java Language: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 46: Line 46:
=Types=
=Types=


Java is a ''statically typed'' language, which means that every [[#Variables|variable]] and every [[#Expressions|expression]] has a type that is known at compile time.
Java is a [[Programming#Static_Typing_vs_Dynamic_Typing|statically typed]] language, which means that every [[#Variables|variable]] and every [[#Expressions|expression]] has a type that is known at compile time.


=Values=
=Values=

Revision as of 19:11, 22 March 2018

Internal

Lexical Structure

Keywords

Statements

synchronized

The synchronized statement acquires a mutual-exclusion lock on behalf of the executing thread, executes a block, then releases the lock. While the executing thread owns the log, no other thread may acquire the lock.

synchronized (expression) block

The type of expression must be a reference type.

Also see:

'synchronized' mechanism

Modifiers

Method Modifiers

synchronized

A synchronized class method synchronizes on the monitor associated with the Class object of that class.

A synchronized instance method synchronizes on the monitor associated with this - the object instance it is invoked onto.

Also see:

'synchronized' mechanism
default

Literals

Operators

Types

Java is a statically typed language, which means that every variable and every expression has a type that is known at compile time.

Values

Variables

Expressions

Interface

An interface groups related methods together into a contract.

Class

Anonymous Class

Can be used for behavior parameterization.

Abstract Class