This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question about charAt() from JQ+ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Question about charAt() from JQ+" Watch "Question about charAt() from JQ+" New topic
Author

Question about charAt() from JQ+

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
The question is:
Which of these statements concerning the charAt() method of the String class are true?
And one of the answers is:
The charAt() method returns a Character object.
As far as I know, and according to the API, it returns a char, which is way different from a Character object.
Clarification?
Jason
Nain Hwu
Ranch Hand

Joined: Sep 16, 2001
Posts: 139
Jason,
Yes, according to API, charAt() should return a char,
not a Character object.
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Was wrong, with the helping of Paul, the very responsive and accomodating individual that I've had a small dialogue with from JQ+, the correct answer was that the charAt() method can take a char for an argument. My apologies to JQ+
Goes to show what happens when you spend too much time studying and no breaks in between (going to grad school, too).
Jason
 
Don't get me started about those stupid light bulbs.
 
subject: Question about charAt() from JQ+