Simple problem

S

stud

error:
'{' expected
'}' expected
what's wrong with my code?
Thanks!!

class insertFailException(String reason) extends SQLException
{
public insertFailedException(String reason)
{
super (reason);
}
public insertFailedException()
{
super();
}
}
 
K

klynn47

The class name does not have a parameter list. The syntax should be
<access control keyword> class className
 
P

Paul van Rossem

error:
'{' expected
'}' expected
what's wrong with my code?
Thanks!!

class insertFailException(String reason) extends SQLException
{
public insertFailedException(String reason)
{
super (reason);
}
public insertFailedException()
{
super();
}
}
Actually, there 2 errors in this piece of code:
1) The class declaration can't have a parameter.
2) The constructor names should be equal to the class name.

Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top