Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-vvkck Total loading time: 0 Render date: 2024-04-28T08:13:35.417Z Has data issue: false hasContentIssue false

2 - Language basics

Published online by Cambridge University Press:  08 January 2010

Clark S. Lindsey
Affiliation:
Space-H Services, Maryland
Johnny S. Tolliver
Affiliation:
Oak Ridge National Laboratory, Tennessee
Thomas Lindblad
Affiliation:
Royal Institute of Technology, Stockholm
Get access

Summary

Introduction

If you buy one of those do-it-yourself furniture kits, the best way to start is to just dump all of those screws, nuts, planks, tools and other odd looking widgets on the floor, group them into piles of similar looking items, and then go read the instructions. Even if you don't know what all of those widgets are for, it helps to pick them up and look them over so that you become familiar with them and can recognize them in the instructions.

So rather than dribbling them out over several chapters, here we dump out most of the basic widgets needed to construct Java programs. The goal is to start to become familiar with Java's symbols, keywords, operators, expressions, and other building blocks of the language with which to construct programs. We provide examples and starter programs (on the Web Course) that allow you to begin to write programs without needing to understand yet all of these language elements at a deep level. You should refer back to this chapter as you proceed and as your understanding of the language increases.

Note that in this chapter we occasionally mention the terms class, method, and object. If you are new to object-oriented programming, do not worry about these terms for now. We discuss them in detail in the following chapters.

We begin with a listing of the basic elements and then outline the structure of a generic program.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2005

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Joseph D. Darcy, What Everybody Using the Java™ Programming Language Should Know About Floating-Point Arithmetic, Sun Microsystems, JavaOne Conference, 2002, http://servlet.java.sun.com/javaone/sf2002/conf/sessions/display-1079.en.jsp
David Flanagan, Java in a Nutshell, 4th edn, O'Reilly, 2002
David Goldberg, What Every Computer Scientist Should Know About Floating-point Arithmetic, Computing Surveys, March 1991, http://docs.sun.com/source/806-3568/ncg_goldberg.html
James Gosling, Bill Joy, Guy Steele and Gilad Bracha, The Java Language Specification, 2nd edn, Addison-Wesley, 2000. Online version at http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html
Java 2 Platform, Standard Edition, API Specification, http://java.sun.com/j2se/1.5/api/
Ronald Mak, Java Number Cruncher: The Java Programmer's Guide to Numerical Computing, Prentice Hall, 2003
Glen McCluskey, Some Things You Should Know about Floating-Point Arithmetic, Java Tech Tips, February 4, 2003, http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2
See also Appendices 1 and 2 for tables of language elements and operators. See Appendix 3 for more about floating-point

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×