Lecture 3

home Contents Index Prev Next

Lecture Topic:

For Loop

Do-While Loop

Like "repeat-until" loop, loop will execute at least once.

Continue

-- Abort out of the iteration.

Break

Data types and their corresponding class

Packages

         packages == like a library in C/C++.



         Syntax:


              import package  typically;



import package classname;

import package * ;



Note:  Extra imports are discarded,  no extra linked code added.

Visibility

-- is field modifier in class

Objects and Classes

--Objects have types




   apple mash (apple a)               // return type Class apple

        {   a.c =0;   return  1;  }



   class Point {                     // Class of Point

           public double x, y;       // data member of Point of class

          }

   Point  p1 = new Point();         // create object of Point

      p1.x = 10;                         // assign value to x

      p1.y = 11;                         // assign value to y

home Contents Index Prev Next

UBLOGO Last Update: 9/23/96
Copyright ©1996 - Douglas Lyon
Lyon@cse.bridgeport.edu