I've posted this question several times. T-T) huhu... i just need the source code in java language. thank you. don't answer #6 i already got it from my previous post. 1: Create a new class with attributes name and address. Both data type will be String. Create a constructor and assign the parameters to the attributes. Now override the toString() method. Is this possible? 2: Create a class with the main method and create an instance of the class that you created in Test Stem 1. What method can you call to get the hashCode of your class? 3: What is the return type of the hash code ? 4: Create an instance of the string in your test class and assign a value. Which of the following operators can be used in conjunction with a string object? + - & . += 5: Supposed that we have a string with a value “This is my string.”. Which method can be used to extract a specific word from the given string? 6: Supposed that we have a string with a value “This is my string.”. Which expression can be used to extract the word “my” from the given string? 7: Now create an String and assign a value with spaces in the beginning, end and middle. Try out the method trim(). What does it do?
I've posted this question several times. T-T) huhu... i just need the source code in java language. thank you. don't answer #6 i already got it from my previous post.
1: Create a new class with attributes name and address. Both data type will be String. Create a constructor and assign the parameters to the attributes. Now override the toString() method. Is this possible?
2: Create a class with the main method and create an instance of the class that you created in Test Stem 1. What method can you call to get the hashCode of your class?
3: What is the return type of the hash code ?
4: Create an instance of the string in your test class and assign a value. Which of the following operators can be used in conjunction with a string object?
- +
- -
- &
- .
- +=
5: Supposed that we have a string with a value “This is my string.”. Which method can be used to extract a specific word from the given string? |
6: Supposed that we have a string with a value “This is my string.”. Which expression can be used to extract the word “my” from the given string?
7: Now create an String and assign a value with spaces in the beginning, end and middle. Try out the method trim(). What does it do?
8: In your test class with main method, instantiate a string buffer with the initial value of “hello”. How will you be able to do that?
9: In your test class with main method, instantiate a string buffer with the initial value of “hello”. Use the method setLength with parameter 2. Print the string representation of the StringBuffer using toString(). What is the result?
10: Which method is not defined in the StringBuffer class?
a.appends
b. codePointCount
c. insert
d. lastIndexOf
Step by step
Solved in 3 steps with 1 images