This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes why hash map contains null Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "why hash map contains null" Watch "why hash map contains null" New topic
Author

why hash map contains null

Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
can any one tell why the patternAsso hashmap contains null value even after being populated with values.

thanks for support


Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

import java.lang.*;
import java.util.*;
import java.io.*;
import java.util.regex.*;

public class pattern
{
patternAsso's keys are made of values taken from patternStrings3.
patternStrings3 is made of p1[hh]+items[mm]+items[nn].
So it will look like "a.* aa", "a.* ab", "a.* ac"...
You forgot that p1 values contains a space. What you want to do is :


PS : try to remove the useless commented code next time


[My Blog]
All roads lead to JavaRanch
Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
@thanks ,i have figured out the problem,sorry,i will follow the rules from next time..

thanks and regards
puneet vyas
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: why hash map contains null
 
Similar Threads
The regular expression to parse �(abc.3, d.42), (cde.2, 3)�
generatinf pattern strings
hash map error
size of vector
Validating date using regex and simple date format