NullPointerException always means that you've tried to access an object that simply isn't there; i.e., a variable's value is null instead of referring to an object. In general, it's a variable followed by a dot (or an open square bracket, if it's an array.)
This is far too much code for me to look at, but if you look at your stack trace it will tell you what line number the exception occurs on. If you then indicate to us exactly which line of code that is, I'm sure we can help you out.
if the code compiles, the confserver object array must be non local. Most probably the array is empty. If it is non local (i.e. an instance variable) it even may be not initialized. In both cases (empty or uninitialized) a null pointer exception is thrown.
Prints null and then throws NullPointerException.
By the way, Krishna, you should give classes identifiers that start with an uppercase letter. Makes the code easier to read (for humans, not for compilers).
krishna balaji wrote
confserver is class in defined how to create array of the class ?
confserver obj; It is declared but not defined and filled yet, not even an empty array, but a reference to a confserver array. Please put the brackets behind the class identifier confserver obj; would be the normal way to say this. The way you did it works, but is unusual and also harder to read. obj is not a nice name for a variable. It tells you nothing.
Declare, initialize and fill an array, example:
all events occur in real time
Joined: Mar 16, 2006
Thank you sir that was very informative now i understand the problmem