• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regex and Generics Notes/Questions

 
megha joshi
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 652
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Megha,
Check out this link for genericsGenerics
 
megha joshi
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fine Job Louis!

I liked generics stuffs.


Thanks,
 
Nik Arora
Ranch Hand
Posts: 652
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Louis,
Thanks for that nice notes................... Its good send me if you have notes for threads.




 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic