File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes why hash map contains null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why hash map contains null" Watch "why hash map contains null" New topic

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é

Joined: Nov 24, 2005
Posts: 14688

import java.lang.*;
import java.util.*;
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
wood burning stoves
subject: why hash map contains null
It's not a secret anymore!