Review notes

Characteristics of Java

how java works

Comments

There are 3 differenet kind of comments.

main

In more detail :

System.out.println(String s)

class

Refer to my notes on classes and object oriented langauge for more detail.

Identifies

Identifies are used to name class, methods, variables.
Not all characters can form an indentify. In below are the basic rules
  1. An identify is a squence of letters , digits, dollar sign $, underscore _.
  2. It cannot begin with a digit.
  3. It cannot be any reserved keywords like , public, class, void ....
  4. Actually it can be in other language (other than English) if you use unicode.
  5. They are case senstive . i.e. myName is different from MyName.

Primitive type

int

float and double

long

char

boolean

Arithemetic

Flow control

Array

String

class and inheritance

You have to know all the material in my handout. This includes

Swing

Layout

BorderLayout

  • You should remember all the constructor.
  • Use BorderLayout.NORTH, BorderLayout.SOUTH,... to specific the direction.
  • use add(component) or add(component, BorderLayout.CENTER) to add to the center.
  • use add(component, BorderLayout.NORTH) etc to add to the north
  • use remove(int) to remove
  • JFrame

    JButton, JLabel