It would help immensely if you could tell us which line throws this exception.

Also, I hope you don't mind that I edited your code and added code tags which should help make your posted code retain its formatting and be more readable.

To do this yourself, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.

Another way to do this is to manually place the tags into your code by placing the tag [cod&#101;] above your pasted code and the tag [/cod&#101;] below your pasted code like so:

Java Code:

[cod&#101;]
// your code goes here
// notice how the top and bottom tags are different
[/cod&#101;]

thanks for the editing as i am new to this i dint noe abt it...
actually i can jst see a warning in the places where 'op.show........' is used it tells "Accessing a static method"..there are no errors in the code but when i execute it it tells java.lang.NullPointerException...Is there anything which i shud change in the code?

actually i can jst see a warning in the places where 'op.show........' is used it tells "Accessing a static method"..there are no errors in the code but when i execute it it tells java.lang.NullPointerException...

Again, you need to tell us more. The NullPointerException message produced by the JVM gives you a lot more information than you're telling us, including the line which is throwing this exception. Unless you tell us this, it will be very hard to help us. You will need to use the line number given to you to find out which line is causing the exception and then show us the line itself, not the number (which won't mean much to us).

Is there anything which i shud change in the code?

One more request, please avoid unnecessary non-standard abbreviations such as "shud", "jst", etc...

Many of us volunteers don't speak English as a primary language and to help us more easily help you, we all appreciate it greatly if you take the effort to fully write out your words.