smallB
smallB

Reputation: 17120

Compilation error in NetBeans

Any idea why this code in NetBeans 7 flags line with Deletion (Deletion is a class within client package) as an error?

package client;

/**
 *
 * @author Arth
 */
public class Client_Main
{
     final String ORIGINAL_SEQUENCE =      "AAGCTGT"; 

         // Sample sequences demonstrating each type of DNA error
         final String MUTATION_SEQUENCE =      "AATCTGT"; 
         final String TRANSPOSITION_SEQUENCE = "AAGTCGT";
         final String INSERTION_SEQUENCE =     "AAGACTG"; 
         final String DELETION_SEQUENCE =      "AGCTGTA"; 

         final String SEQUENCE_A =      "AAAAACCCCCGGGGGTTTTT";
         final String SEQUENCE_B =      "AAAACACCCCGGGGGTTTTT";

         public void check()
         {
             Deletion d("1","2");
         }

}

The line:

Deletion d("1","2");

produces the error:

';' is expected

Upvotes: 0

Views: 121

Answers (4)

Buhake Sindi
Buhake Sindi

Reputation: 89169

Alternatively, if you're not assigning d, you can just simply call the object directly, like so:

new Deletion("1", "2");

Upvotes: 0

jaybee
jaybee

Reputation: 1925

You haven't really given enough info but try

Deletion d = new Deletion("1", "2");

Upvotes: 0

Vladimir Ivanov
Vladimir Ivanov

Reputation: 43098

This syntax is illegal. If you want to create a new object you should either use in-place initialization:

Deletion d = new Deletion("1", "2");

or initialize after the declaration:

Deletion d;
d = new Deletion("1", "2");

Upvotes: 1

Prince John Wesley
Prince John Wesley

Reputation: 63698

Deletion d = new Deletion("1","2");

Upvotes: 0

Related Questions