About Question enthuware.ocajp.i.v7.2.1184 :
Moderators: Site Manager, fjwalraven
About Question enthuware.ocajp.i.v7.2.1184 :
Hi everyone!
I don't understand the third statements. I don't know why contents of b1.
Thanks in advance.
I don't understand the third statements. I don't know why contents of b1.
Thanks in advance.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
In the third case:
b2.substring(4) => "yoodler".substring(4) => "ler"
b1.replace(3, 4, b2.substring(4)) => b1.replace(3, 4, "ler") => "snorkler".replace(3, 4, "ler") =>snolerkler
b2.append(false) => "yoodlerfalse"
b1.replace(3, 4, b2.substring(4)).append(b2.append(false)) =>"snolerkler".append("yoodlerfalse") => snolerkleryoodlerfalse
HTH,
Paul.
b2.substring(4) => "yoodler".substring(4) => "ler"
b1.replace(3, 4, b2.substring(4)) => b1.replace(3, 4, "ler") => "snorkler".replace(3, 4, "ler") =>snolerkler
b2.append(false) => "yoodlerfalse"
b1.replace(3, 4, b2.substring(4)).append(b2.append(false)) =>"snolerkler".append("yoodlerfalse") => snolerkleryoodlerfalse
HTH,
Paul.
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Is there a definitive subset of String/StringBuffer/ArrayList methods we have to know? I don't
think it's feasible to learn all of them (for me, at least).
If not, is there a probable subset?
Thanks,
Karen
think it's feasible to learn all of them (for me, at least).
If not, is there a probable subset?
Thanks,
Karen
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Yes, you need to learn about :
substring
replace
charAt
indexOf
length
toLower/UpperCase
compareTo
equals
equalsIgnoreCase
contains
endsWith
startsWith
valueOf
trim
Almost all are very straightforward and their names tell you what they do.
HTH,
Paul.
substring
replace
charAt
indexOf
length
toLower/UpperCase
compareTo
equals
equalsIgnoreCase
contains
endsWith
startsWith
valueOf
trim
Almost all are very straightforward and their names tell you what they do.
HTH,
Paul.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
I have made a list here as well.
Re: About Question enthuware.ocajp.i.v7.2.1184 :
In the book there is a wrong answer for b1 for the third row of table.
It is "olerkleryoodlerfalse", but should be "snolerkleryoodlerfalse".
It is "olerkleryoodlerfalse", but should be "snolerkleryoodlerfalse".
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Hi sunkrup,
You are right. The size of the textbox is a little smaller than the word and that is why the beginning two letters are not being displayed in the image. This has now been updated.
thank you for your feedback.
Paul
You are right. The size of the textbox is a little smaller than the word and that is why the beginning two letters are not being displayed in the image. This has now been updated.
thank you for your feedback.
Paul
-
- Posts: 32
- Joined: Wed Mar 14, 2012 5:45 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Hi Paul,admin wrote:Hi sunkrup,
You are right. The size of the textbox is a little smaller than the word and that is why the beginning two letters are not being displayed in the image. This has now been updated.
thank you for your feedback.
Paul
I'm using the kindle version and i still have the small box with the missing character, any idea how to update?
Thanks.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Hi Babtize,
I am not sure how the update works with Amazon. May be you can delete your copy from your device and redownload it?
-Paul.
I am not sure how the update works with Amazon. May be you can delete your copy from your device and redownload it?
-Paul.
-
- Posts: 32
- Joined: Wed Mar 14, 2012 5:45 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
I have automatic update turned on but haven't seen any updates?admin wrote:Hi Babtize,
I am not sure how the update works with Amazon. May be you can delete your copy from your device and redownload it?
-Paul.
- Attachments
-
- Screen Shot 2013-04-21 at 12.11.35 PM.png (28.16 KiB) Viewed 7016 times
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
OK, let me investigate this and get back to you. I will also need to contact Amazon about it so it might take some time.
HTH,
Paul.
HTH,
Paul.
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
Hi,
It seems it is updated in the book as well. I can see that in the book on kindle.
-Paul.
It seems it is updated in the book as well. I can see that in the book on kindle.
-Paul.
-
- Posts: 1
- Joined: Fri Dec 20, 2013 9:47 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
For b1.replace(3,4,b2.substring(4)).... it seems that the method b1.replace takes 3 parameters which are 3, 4, and b2.substring(4)-> ler. What does the second parameter, the 4 in this instance, mean? What does this method look like? I can't seem to find in API. The only two I see in API are:
1. replace(char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
2. replace(CharSequence target, CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.
Thank you
1. replace(char oldChar, char newChar)
Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar.
2. replace(CharSequence target, CharSequence replacement)
Replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence.
Thank you
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
-
- Posts: 36
- Joined: Tue May 06, 2014 8:30 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
I don't understand how b2.substring(2,5) = keeps the value unchanged in column 2, row 1.
-
- Posts: 36
- Joined: Tue May 06, 2014 8:30 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1184 :
nevermind.. I got it now. substring does not modify the object's value.
Who is online
Users browsing this forum: No registered users and 9 guests