Introduction Java Chapter 3
Java Developed by Sun Microsystem High-level programming language One reason for its wide-spread use is the ability to create platform-independent applications.
Object, Classes, & Packages An object consists of related data and the instructions for performing actions on that data. A class defines the type of data actions that will be associated with an object of that class. A package, sometimes called a library, is a group of related classes.
Object, Classes, & Packages Library Classes Fiction Biography Object Names of books Names of books
A Java Application Statements are a set of instructions Semicolon (;) is required to indicate the end of a statement. { } enclose related statements Start with a Package Name Define a class Define an object
Java Program Source code is the code the programmer types Compiler is used to change the program in to 0 & 1 that the computer can understand. Syntax error occurs in a statement that violates the rules of Java
Code Conventions An introductory comment should begin a program. Package names should begin with a lowercase Class names should be nouns and begins with an uppercase letter. A comment block should be included before each class.
Code Conventions Comments should not repeat what is clear from looking at the code. Statements in a method should be indented. An open curly brace { should be placed on the same line as the class or method declaration.
Planning Code One method of design is called algorithm. Pseudocode is steps written out in plain English. Flow Charts are symbols and text to give visual representation of solution Pg.66 is an example.
Hello World Use Jcreator to complete the 1st program. Pg. 61, 63, 64