reset password
Author Message
Anonymous
Posts: 166
Posted 13:46 Oct 06, 2013 |

In the section R 2.18 says

"Consult the API documentation to find methods"

What exactly do we have to do?

Do we just copy and paste the code?

For example: * Concatenating two strings, that is, making a string consisting of the first string, followed by the second string.

So, do we just copy the 

public String concat(String str) or what do we do?
Anonymous
Posts: 166
Posted 17:18 Oct 06, 2013 |

I thought that just meant that we needed to consult the Java online documentation. That's how I figured things out anyway...

 

...maybe I'm wrong though.

hal255
Posts: 51
Posted 17:30 Oct 06, 2013 |

I used the following format as explained in the videos:

object.method.(arguments);

In your case, you already know the type of object, just think of a variable name for it. You already know the method you want to use, which is concat. If you look up concat in the javadocs, it will list the arguments needed for the method to work. Use BlueJ (or the compiler you're using) to test it. Good luck.

Last edited by hal255 at 14:09 Oct 07, 2013.