• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

why hash map contains null

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can any one tell why the patternAsso hashmap contains null value even after being populated with values.

thanks for support


 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Puneet N Vyas
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@thanks ,i have figured out the problem,sorry,i will follow the rules from next time..

thanks and regards
puneet vyas
reply
    Bookmark Topic Watch Topic
  • New Topic