Chapter 3. Fundamental Programming Structures in Java

   

Core Java™ 2: Volume I - Fundamentals
By Cay S. Horstmann, Gary Cornell
Table of Contents


  • A SIMPLE JAVA PROGRAM

  • COMMENTS

  • DATA TYPES

  • VARIABLES

  • ASSIGNMENTS AND INITIALIZATIONS

  • OPERATORS

  • STRINGS

  • CONTROL FLOW

  • BIG NUMBERS

  • ARRAYS

At this point, we are assuming that you successfully installed the Java SDK and were able to run the sample programs that we showed you in Chapter 2. It's time to start programming. This chapter shows you how the basic programming concepts such as data types, branches, and loops are implemented in Java.

Unfortunately, in Java you can't easily write a program that uses a graphical user interface you need to learn a fair amount of machinery to put up windows, add text boxes and buttons that respond to them, and so on. Since introducing the techniques needed to write GUI-based Java programs would take us too far away from our goal of introducing the basic programming concepts, the sample programs in this chapter will be "toy" programs, designed to illustrate a concept. All these examples will simply send output to a console window. When it comes to getting user input, we will stick to reading the information from a pop-up window. In particular, we will be writing applications rather than applets in this chapter.

Finally, if you are an experienced C++ programmer, you can get away with just skimming this chapter: concentrate on the C/C++ notes that are interspersed throughout the text. Programmers coming from another background, such as Visual Basic, will find most of the concepts familiar and all of the syntax very different you will want to read this chapter very carefully.


       
    Top
     



    Core Java 2(c) Volume I - Fundamentals
    Building on Your AIX Investment: Moving Forward with IBM eServer pSeries in an On Demand World (MaxFacts Guidebook series)
    ISBN: 193164408X
    EAN: 2147483647
    Year: 2003
    Pages: 110
    Authors: Jim Hoskins

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net