Hi. im kinda new here . i just want some help with this code i cant seem to figure out my problem, i already declared a constructor but it keeps on saying cannot find symbol when i compile it -_-
import javax.swing.JOptionPane;
import java.io.*;
public class Sample_Thread {
public static class Thread1 extends Thread {//thread class
public String title;
public int length;
public String string1[];
public String string2[];
int transversion = 0;
int transition = 0;
public Thread1(String name, int len, String a[], String b[]) {
title = name;
length = len;
string1 = a;
string2 = b;
}
public void run() {
System.out.print(title+"\t\t ");
for(int i=0; i<length; i++) {
if(
(string1[i].equals("A"))&&(string2[i].equals("T")) ||
(string1[i].equals("T"))&&(string2[i].equals("A")) ||
(string1[i].equals("C"))&&(string2[i].equals("G")) ||
(string1[i].equals("G"))&&(string2[i].equals("C"))
)
transversion++;
else if(
(string1[i].equals("A"))&&(string2[i].equals("G")) ||
(string1[i].equals("G"))&&(string2[i].equals("A")) ||
(string1[i].equals("T"))&&(string2[i].equals("C")) ||
(string1[i].equals("C"))&&(string2[i].equals("T"))
)
transition++;
}
System.out.print(transversion+"\t\t "+transition+"\n");
}
}
public static void main(String[] args){
Lipa_Thread obj = new Lipa_Thread();
String[] sequence = new String[10];
String s = "stop";
int totalS = 0,baseLength = 0;
System.out.println("CMSC 191 Thread");
System.out.println("Please input DNA SEQUENCE to analyze.");
System.out.println("*There can only be a MAXIMUM of 10 input strings/lines and MINIMUM of 2 lines.");
System.out.println("*Type 'stop' to end");
do{
sequence[totalS] = JOptionPane.showInputDialog("Please input string["+(totalS+1)+"]:");
if(totalS==0) baseLength = sequence[0].length();
totalS = totalS +1;
}while( (!sequence[totalS-1].equals(s)) && (totalS!=5) );
totalS--;
if((totalS)<2){
System.out.println("Cannot evaluate with only 1 or no string.");
System.exit(1);
}
else{
System.out.println("Analyzing....");
Thread1[] thr = new Thread1[totalS];
int tcount = 0;
String aa = "";
String bb = "";
String tt = "";
System.out.println("\t\t\tTransversion\t\tTransition");
for(int i=0; i<(totalS-1); i++){
for(int j=i+1; j<totalS; j++){
tt = "A["+(i+1)+"] vs. A["+(j+1)+"] = ";
aa = sequence[i];
bb = sequence[j];
//MyThread thr[tcount] = new MyThread( "A["+(i+1)+"] vs. A["+(j+1)+"] = ", baseLength, sequence[i], sequence[j] );
thr[0] = new Thread1( tt , baseLength, aa, bb);
thr[tcount].start();
thr[tcount].sleep(1000);
tcount++;
}
}
}
}
}
it keeps on saying cannot find symbol on the line "thr[0] = new Thread1( tt , baseLength, aa, bb);", just 10 lines above this line.
it tells of symbol Sample_thread.Thread1(string......) sorry for the trouble but could you help me? please