Javin Paul wrote:
are you aware of stack trace ?
Whenever a thread calls a method it put it into its stack and when an Exception get thrown it unwind this stack until Exception get caught or until thread dies. this stack trace is useful to find out where exactly problem lies. just run your program with some other String "Symbiosis" and you will know why need to print stack trace.
in the above program we have made a "comparestring" method and passed a string parameter to it and now if the string str matched with "Symbiosis" it prints string are equal otherwise it throws a exception. now in main method we have called "comparestring" with "arg[0]" as argument......how we have used arg[0] to match it with "Symbiosis" and please explain the below code....according to me we have made a "nomatchexception" class and extends exception class....
then we have declared a nomatchexception method and passed strind parameter to it and then why we have super(meaasge) here......i know super is used to call the parent class...but here what message it will print here.....???
also if i am wrong somewhere..please tell....
thank you so much for your previous reply.....