Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
static void AddNewCustomer()
{
    try
    {
        int id;
        String UniqCustID, uniqcustid, newcust, UniqueNumber;

        do
        {
            UniqCustID  = "Please enter unique customer id : ";
            uniqcustid  = JOptionPane.showInputDialog( UniqCustID );

            UniqueNumber(id, newcust);

            if (UniqueNumber(id, newcust) == false)
            {
                JOptionPane.showMessageDialog(null, "Customer id already exists or you entered a number less than 1!");
        }



im getting that error at static void AddNewCustomer()...why is that? is syntax correct?
Posted
Updated 16-Feb-10 6:24am
v2

Is that the complete code?

You're probably missing a curly bracket ( } ) somewhere, or maybe you have one or more unneccesary curly brackets somewhere.
 
Share this answer
 
v2
The portion of code that you have posted is incomplete, as you can see now that I have reformatted it. There is also no way of knowing what you have before the statement in error. Please post the preceding lines so that we may assist you.
 
Share this answer
 
I have added the syntax as a message. Please view it there. thanks :)
 
Share this answer
 
I looked at the message you posted, and as far as I can see, the main method hasn't been closed (missing } at the end).
Also, your class hasn't been closed.
 
Share this answer
 
v2
it is closed, as i said, it is the the syntax before and some after it. after that are the same "procedures" for the rest of the cases, then i closed the main. thanks for you help, but im sure its not from that.
 
Share this answer
 
This is confusing me.. Did you close your main method BEFORE declaring your AddNewCustomer method? It's hard to figure out the problem when you're only posting parts of the code. The main method (and all other methods) must be closed *before* declaring a new method - you can't declare a new method within a method.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900