Java syntax together. The following lists the typical
Java syntax together. The following lists the typical language elements and shows how the language syntax is concerned with these elements: Identifiers: How are variable names composed? What are the naming restrictions and conventions? Literals: How are constant names composed? How are their values assigned? Keywords: What are the language s predefined words? How are they used and how are they not used? Statements: What is a statement and how is one written? Code blocks: How are statements grouped together? Comments: How can the programmer add comments and notes to the program? Expressions: What is an expression and how is one written? Operators: What are the operators used in the language? How are they used in expressions? Can a programmer define his/her own operators? Identifiers An identifier is a name that uniquely identifies a variable, a method, or a class (we will discuss variables later in this chapter; methods and classes are discussed in Chapter 10, Object-oriented programming in Java ). In most languages, there are restrictions on how identifiers are composed. The following lists Java s restrictions on identifiers: All identifiers must begin with a letter, an underscore ( _ ), or a dollar sign ($) An identifier can include, but not begin with numbers An identifier cannot include a white space (tab, space, linefeed, or carriage return) Identifiers are case-sensitive Java keywords cannot be used as identifiers Note Since some C library names begin with an underscore or a dollar sign, it is best to avoid beginning an identifier name with these characters. Importing a C library into a program that uses an underscore or a dollar sign to start an identifier name might cause name clashing and confusion. In addition to these restrictions, certain conventions are used with identifiers to make them more readable. Although these conventions do not affect the compiler in any way, it is considered a good programming 9-2 Learning Java with JBuilder
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services