The Artima Developer Community
Sponsored Link

Java Buzz Forum
Java 101: Deciding and iterating with Java statements

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
News Manager

Posts: 47623
Nickname: newsman
Registered: Apr, 2003

News Manager is the force behind the news at Artima.com.
Java 101: Deciding and iterating with Java statements Posted: Jun 30, 2015 3:07 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by News Manager.
Original Post: Java 101: Deciding and iterating with Java statements
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Latest Java Buzz Posts
Latest Java Buzz Posts by News Manager
Latest Posts From JavaWorld

Advertisement

Java applications evaluate expressions in the context of statements, which are standalone islands of code that accomplish various tasks such as declaring a variable, making a decision, or iterating over statements. A statement can be expressed as a simple statement or as a compound statement:

  • A simple statement is a single standalone instruction for performing a task; it must be terminated with a semicolon character (;).
  • A compound statement is a sequence of simple and other compound statements located between open- and close-brace characters ({ and }), which delimit the compound statement's boundaries. Compound statements can be empty, will appear wherever simple statements appear, and are alternatively known as blocks. A compound statement is not terminated with a semicolon.

In this article I introduce you to using statements in your Java programs. You can use statements to to declare variables and specify expressions, make decisions, iterate over statements (yes, you can use statements to iterate over statements), break and continue iteration, and do nothing. I'll leave some of the more exotic statements (such as statements for returning values from called methods and for throwing exceptions) for a future Java 101 article.

To read this article in full or to leave a comment, please click here

Read: Java 101: Deciding and iterating with Java statements

Topic: FREE JBoss WildFly eBooks giveaway from Java Code Geeks and Packt (total value of $490)! Previous Topic   Next Topic Topic: FREE JBoss WildFly eBooks giveaway from Java Code Geeks and Packt (worth $49)!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use