This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Some pointers (some more important than others, but all hopefully useful):
Java class names by convention start with an upper case letter. This seems trivial, but in the long run makes working with code much easier
The line String  a = new String; creates an array with one element. Are you sure you will only ever have one element? If not, consider on of the Collections classes that can grow and have methods to return arrays. (see java.util package)
String b = reader.readLine() only reads one line. Are you sure there will only ever be one line?
"It doesn't work" doesn't really make it all that easy for us to help you. Tell us HOW it doesn't work. Tell us what you are doing when it doesn't work, and what you think it should do. The easier you make it for someone who reads your post, the more likely you will get an answer that solves your problem.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors