Professional Documents
Culture Documents
The Java™ Tutorials: Variables
The Java™ Tutorials: Variables
Lesson:LanguageBasics(TheJavaTutorials>LearningtheJavaLanguage)
Documentation
TheJavaTutorials
Trail:LearningtheJavaLanguage
Lesson:LanguageBasics
Variables
You'vealreadylearnedthatobjectsstoretheirstateinfields.However,theJavaprogramminglanguagealsousestheterm"variable"aswell.This
sectiondiscussesthisrelationship,plusvariablenamingrulesandconventions,basicdatatypes(primitivetypes,characterstrings,andarrays),
defaultvalues,andliterals.
Operators
ThissectiondescribestheoperatorsoftheJavaprogramminglanguage.Itpresentsthemostcommonlyusedoperatorsfirst,andtheless
commonlyusedoperatorslast.Eachdiscussionincludescodesamplesthatyoucancompileandrun.
Expressions,Statements,andBlocks
Operatorsmaybeusedinbuildingexpressions,whichcomputevaluesexpressionsarethecorecomponentsofstatementsstatementsmaybe
groupedintoblocks.Thissectiondiscussesexpressions,statements,andblocksusingexamplecodethatyou'vealreadyseen.
ControlFlowStatements
ThissectiondescribesthecontrolflowstatementssupportedbytheJavaprogramminglanguage.Itcoversthedecisionsmaking,looping,and
branchingstatementsthatenableyourprogramstoconditionallyexecuteparticularblocksofcode.
Youruseofthispageandallthematerialonpagesunder"TheJavaTutorials"bannerissubjecttothese
legalnotices.
Copyright1995,2015Oracleand/oritsaffiliates.Allrightsreserved.
Problemswiththeexamples?TryCompilingandRunningthe
Examples:FAQs.
Complaints?Compliments?Suggestions?Giveusyourfeedback.
Previouspage:PreviousLesson
Nextpage:Variables
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/index.html
1/1