Home arrow Java arrow Java Part 2: Syntax

Java Part 2: Syntax

In this, part two of this ten part series on Java, Chris looks at the Java language syntax, variable declerations, truth conditions, loops and more. He finishes by wrapping everything up into a simple Java function.

Author Info:
By: Chris Noack
Rating: 5 stars5 stars5 stars5 stars5 stars / 9
November 27, 2001
  1. · Java Part 2: Syntax
  2. · Decleration and assignment
  3. · Making code more readable
  4. · Truth operations
  5. · Iterations and looping
  6. · The while loop
  7. · Putting it all together
  8. · Conclusion

print this article

Java Part 2: Syntax
(Page 1 of 8 )

In this, the second article of ten in the series, I will talk about the Java language syntax and other language related areas including variable declerations, looping, truth conditions and variable assignments.

Let's start with some basic Java language rules:

Each line of code must be immediately followed by a semicolon (;). The semi-colon must come before anything else or it will be considered by the Java compiler as being part of that line of code.

A variable should be declared before it is referred to in your code. Although in Java, it is not mandatory to do so, it does help to increase code readability if you do.

The Java compiler is not white space sensitive. White space is tolerated but must not be used within variable declarations. For example, variable_1 is valid as opposed to variable 1, which contains white space. Variable names should start with an alphabetic character, and can contain any combination of alphanumeric characters, including the underscore character.
blog comments powered by Disqus

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials