GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regex  and  Generics Notes/Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regex  and  Generics Notes/Questions" Watch "Regex  and  Generics Notes/Questions" New topic
Author

Regex and Generics Notes/Questions

megha joshi
Ranch Hand

Joined: Feb 20, 2007
Posts: 206
Hi all,

I need help with Regex and Generics, two objectives where my concepts are still weak. I know its a very broad question but if you have some points that I should keep in mind , some notes or some interesting questions on these topics...please post them in this thread.

Any help would be nice.

Thanks,
Megha
Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi Megha,
Check out this link for genericsGenerics
megha joshi
Ranch Hand

Joined: Feb 20, 2007
Posts: 206
Thanks Nik..I saw document...I am looking for something more concise...and to the point ... some bullet points to keep in mind for generics questions

For regex...
First question...
Can someone please explain whats the null string output when using \\w* in regex with string using split. I know there were two threads on this forum on this before but I really dont understand when the null string matches word or ...what are the rules...

Second question...
I wrote the following code...can anyone shed some light on the rationale behind the different outputs from three methods using regex here...


Output:
Split output
><
> <
><
><
Patter Matcher output
0,><
1,>apples<
7,><
Scanner output
> <

Thanks,
Megha
Louis Moloney
Ranch Hand

Joined: Feb 06, 2007
Posts: 59
Hi I am currently studying for SCJP ,here are some notes i made on those topics (they are abit quick and dirty). Let me know what you think

http://docs.google.com/Doc?id=dgxbdmcg_2ggwr25

http://docs.google.com/Doc?id=dgxbdmcg_1fvnz3r
[ May 10, 2007: Message edited by: Louis Moloney ]

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Fine Job Louis!

I liked generics stuffs.


Thanks,


cmbhatt
Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi Louis,
Thanks for that nice notes................... Its good send me if you have notes for threads.




Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,

How things work.

Have a look at this:


output:
Using "\\." as delimiter in Scanner
--------------------

>abc<
>sr<
>stryr<
>ds<
Using . (delimiter) as delimiter in Scanner
--------------------
><
><
><
><
><
><
><
><
><
><
><
><
><
><
Using .* delimiter in the Scanner
--------------------
Using .* pattern to find
--------------------
0>abc.sr.stryr.ds<
Using .(metacharater) as split delimiter
--------------------
Using Limit parameter to include all blank matches
--------------------
><
><
><
><
><
><
><
><
><
><
><
><
><
><
><
><


-----------
Thanks,
Louis Moloney
Ranch Hand

Joined: Feb 06, 2007
Posts: 59
glad you liked the notes guys. I haven't made any on threads yet, but intend to soonish. I will post them when i do.
 
GeeCON Prague 2014
 
subject: Regex and Generics Notes/Questions