It's not a secret anymore!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes split() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "split() method" Watch "split() method" New topic
Author

split() method

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Hi, This is from whizlabs, I think the reason for first output is "s" represents space..why commas are coming. "e" represent what ? why no commas ?


OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Harikrishna Gorrepati wrote:Hi, This is from whizlabs, I think the reason for first output is "s" represents space..why commas are coming. "e" represent what ? why no commas ?

You'll want to look at the regular expressions tutorials to see what \\s and \\e actually represent and also the java.util.Arrays api for what is returned by its toString method. I'll help you a bit with the latter -- Note the different outputs:


Luck!
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

Harikrishna, I don't wish to be rude, but what have you done so far to study Java? Have you gone through the Oracle tutorials, read any books on Java?

I think you would benefit a lot from doing some proper studying, before you ask all these questions.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Stephan van Hulst wrote:Harikrishna, I don't wish to be rude, but what have you done so far to study Java? Have you gone through the Oracle tutorials, read any books on Java?

I think you would benefit a lot from doing some proper studying, before you ask all these questions.


Indeed, I hadn't seen the volume of your questions til now. Asking questions in the forum is not a substitute for studying.
Arjun Srivastava
Ranch Hand

Joined: Jun 23, 2010
Posts: 432

Stephan van Hulst wrote:Harikrishna, I don't wish to be rude, but what have you done so far to study Java? Have you gone through the Oracle tutorials, read any books on Java?
I think you would benefit a lot from doing some proper studying, before you ask all these questions.

None of the question is small or worthless.Sometimes we get even confuse in addition-subtraction questions.
If your friend is asking something then he must having a problem understanding the same.
So instead giving excuse,it will be better to provide him solutions or any link that will help your friends.

SCJP 6 | FB : Java Certifications-Help. | India Against Corruption
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

I'm not making excuses, I'm more than happy to help him. In this case, I hope he'll take my advise and study.

It's much more easy to study and then ask questions, instead of just looking at examples and then asking questions.
Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 422
Stephan van Hulst wrote:I'm not making excuses, I'm more than happy to help him. In this case, I hope he'll take my advise and study.

It's much more easy to study and then ask questions, instead of just looking at examples and then asking questions.
Hi Stephan/ Pete, I appreciate and thanks for your suggestion. Before I ask the question, I put all my efforts to solve it. This particular topic in chapter 6 is very confusing. That' why I raised this question. If you can send some sample tutorial links, that would be really helpful.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3615
    
  14

Have you read the Oracle tutorials? If you haven't, you probably will be familiar with a lot of it, but it can't harm to go over the topics which you don't fully understand again. These lessons are very clear:

http://download.oracle.com/javase/tutorial/
Adi Dinita
Greenhorn

Joined: Oct 21, 2010
Posts: 5
I don't believe he will find this kind of non-printable special chars in the tutorial.

Harikrishna, I believe this will help: http://www.regular-expressions.info/characters.html

Stephan van Hulst wrote:Have you read the Oracle tutorials? If you haven't, you probably will be familiar with a lot of it, but it can't harm to go over the topics which you don't fully understand again. These lessons are very clear:

http://download.oracle.com/javase/tutorial/
 
 
subject: split() method