Computer Science 132
Introduction To Computing II
Dickinson College
Spring Semester 2001
Grant Braught
Class #21 - Using Java's Classes 2
Main Ideas For Today 
- Objects and Classes
- String class
- StringBuffer Class
- Accessor methods
- Mutator methods
- Static methods
- Mutable vs. Immutable types
- String, StringBuffer, Integer, Double, Point classes
- Objects and References
- Object References as Parameters
Reading Assignment For Today 
- Java by Dissection: Chapter 6, 6.1-6.2, 6.10
Review Questions For Today 
Due Date: 6:00 am
- Java by Dissection: Chapter 6, Review Questions: 1, 2, 5.
- Write a Java program that:
- Prompts the user for the the location and dimensions of a rectangle.
- Creates a new instance of the Rectangle object with the specified values.
- Prompt the user for the x,y coordinate of a point.
- Print's a message indicating if the specified point is inside or outside the rectangle.
HINT: See the contains method of the Rectangle class.
Solutions - posted after due date.
Web Sites Related to Today's Topic 
Sample Code For Today's Class 
- PointDist.java - Uses Point objects to find the distance between two points.
- ObjRefs.java - Demonstrates how references and objects interact.
- Palindrome.java - Use the String and StringBuffer classes to test a string to see if it is a palindrome.