public class MultithreadingFour {
public static void main(String args[]){
A obj = new A();
Task task= new Task();
for(int i=0; i<10; i++)
Thread t= obj.newThread(task);
}
}
błąd kompilacji: Wiele znaczników na tej liniiDla pętli wsporników
Syntax error, insert ";" to complete Statement
t cannot be resolved to a variable
Syntax error, insert "AssignmentOperator Expression" to complete Assignment
Syntax error, insert ":: IdentifierOrNew" to complete ReferenceExpression
Thread cannot be resolved to a variable
natomiast
public class MultithreadingFour {
public static void main(String args[]){
A obj = new A();
Task task= new Task();
for(int i=0; i<10; i++){
Thread t= obj.newThread(task);
}
}
}
kompiluje pomyślnie (nota dodanych nawiasy klamrowe w pętli for
).
O co dokładnie pytasz? –