Arrays are ordered collections of values of a single type. Arrays
are not primitive types, they are aggregates.
Arrays are reference types (like classes). That is, when you declare a
variable of "array type", you are actually declaring a reference
Generating bitmap files from vector graphics
After you've drawn a vector image, you can save it to a bitmap image file.
The process involves rasterisation of the vectors into pixels. This process
also happens when the vector image is displayed on a raster
cfw_ System.out.println("X is greater than 5");
else if (expression)
else if (x=5) & (equivalenceTest=true)
cfw_ System.out.println("X is exactly 5");
Java Primitive Data Types
boolean (true or false)
char (unicode character)
Type Conversions between Primitive Types
Java's interpretter wi
Bitmap image compression
Image compression schemes may be lossy or lossless.
Discard pixel information. They may therefore obtain very high
Reconstruct an image by approximation.
Offer a range of quality / compression trad
int a = 1, b = 2;
if (a = b) cfw_ System.out.println("a and b hold the same
Point2D p1 = new Point2D(1.0, 1.0);
Point2D p2 = p1;
Point2D p3 = new Point2D(1.0, 1.0);
if (p1 = p2) cfw_ System.out.println("p1 and p2 are
Java Classes and Objects
The basic elements of a Java program are classes created as part of
abstraction hierachies (as discussed in lecture 1b).
A class is a named collection of:
Fields that hold data values (they may also be called data members)
Object-based / Vector images
Vector images are a collection of geometric shapes: lines;
ellipses; rectangles; polygons. These may be edited interactively
by moving control points, usually line mid / end points.
As a programmer, to create a vector image yo
SAMPLE EXAM QUESTIONS CSE5910 Multimedia Programming in Java
Section A : Java Programming
1. 2. 3. In the context of Java, what is a .class file. What is it for? (~3 lines) What is the role of the Java interpreter? How does it contribute to making Java so
Working with bitmap images in Java
Java graphics libraries include:
java.awt - the abstract window toolkit. An early, basic toolkit for using a
platform's native GUI elements.
javax.imageio - classes for reading and writing bitmap images in JPEG,
Strings and String Literals
In Java, strings are objects (not built in types like int, double etc.)
The class definitions for String are all provided for you (you don't need to
write a class String yourself)
You can make a String object using "double quot
/ Make an array of 10
arrays of 10 doubles
twoDimensionalArray = new
Left is an image of the
layout for a two
dimensional array (i.e. an
array of arrays).
Cells are accessed by two
indices. For example.
What is a digital image?
There are basically two types of images, Bitmap and Vector images.
Bitmap images are what you most often find on web pages or
being produced by your digital camera.
They consist of a grid of coloured points called pi