Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Java syntax
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Set of rules defining correctly structured program}} {{See also|Java (programming language)#Syntax}} {{More footnotes|date=January 2014}} {{Use mdy dates|date=April 2025}} {{Use American English|date=April 2025}} [[File:Java keywords highlighted.svg|thumb|300px|A snippet of Java code with keywords highlighted in bold blue font]] The '''syntax of 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 C++, Java has no global functions or variables, but has data members which are also regarded as [[global variable]]s. All code belongs to [[Class (computer programming)|classes]] and all values are [[Object (computer science)|objects]]. The only exception is the [[primitive data types]], which are not considered to be objects 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]] [[data type]]s are omitted to simplify the language and avoid possible programming mistakes. The Java syntax has been gradually extended in the course of numerous major [[JDK]] [[Java version history|releases]], and now supports abilities such as [[generic programming]] and [[anonymous function]]s (function literals, called lambda expressions in Java). Since 2017, a new JDK version is released twice a year, with each release improving the language incrementally.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)