|
(Review:) How can you determine what an object of a particular class can do? A good answer might be:The variables and methods of a class will be documented somewhere. | ||
Class StringWith a Java development environment such as such as Borland JBuilder or Symantec Café the documentation is on line (push F1). If you downloaded the JDK from Sun Microsystems, look on your hard disk, in someplace like C:\jdk1.2.2\docs\index.html. Here is a short version of the documentation for String. There are more methods than in this list.
The documentation first lists constructors. Then it says how to call the methods. For example,
| ||
QUESTION 7:Is the following code correct? You don't have to know what this does; just look at the documentation and see if the types of all the parts are correct. Click Here after you have answered the questionString first = "Kublai" ; String last = " Khan" ; String name = first.concat( last ); |