Java Reference
In-Depth Information
Exercise 3.45
Add a subject line for an e-mail to mail items in the
mail-system
project.
Make sure printing messages also prints the subject line. Modify the mail client accordingly.
Exercise 3.46
Given the following class (only shown in fragments here),
public class Screen
{
public Screen(int xRes, int yRes)
{ ...
}
public int numberOfPixels()
{ ...
}
public void clear(boolean invert)
{ ...
}
}
write some lines of Java code that create a
Screen
object. Then call its
clear
method if (and
only if) its number of pixels is greater than two million. (Don't worry about things being logical
here; the goal is only to write something that is syntactically correct—i.e., that would compile
if we typed it in.)
Search WWH ::
Custom Search