Java syntax: Difference between revisions

Content deleted Content added
m Comments: +wikilink
m top: bold keywords should not be wikilinks
Tags: Mobile edit Mobile app edit Android app edit
Line 4:
[[File:Java keywords highlighted.svg|thumb|300px|A snippet of Java code with keywords highlighted in bold blue font]]
 
The '''[[Syntax (programming languages)|syntax]] of [[Java (programming language)|Java]]''' is [[syntax|the set of rules]] defining how a [[Java (programming language)|Java]] program is written and interpreted.
 
The [[Syntax (programming languages)|syntax]] is mostly derived from [[C (programming language)|C]] and [[C++]]. Unlike in C++, in Java there are no global functions or variables, but there are data members which are also regarded as [[global variable]]s. All code belongs to [[class (computer science)|classes]] and all values are [[object (computer science)|objects]]. The only exception is the [[primitive types]], which are not represented by a class instance for performance reasons (though can be automatically converted to objects and vice versa via [[#Boxing and unboxing|autoboxing]]). Some features like [[operator overloading]] or [[unsigned integer]] types are omitted to simplify the language and to avoid possible programming mistakes.