Hi Guys
I not expert in thread either any programing lanauge.but I still learning java.I got a problem once i wrote some java coding.It's not a syntax error.I want to how know to do this.Below i metion coding
public class Test137 {
public static void main(String[] args){
String[] str={"TOM","ANNE","RYABN","SAM"};
for(int i=0;i<str.length;i++){
System.out.println(str[i]);
}
for(int j=str.length-1;j>=0;j--){
System.out.println(str[j]);
}
}
in above coding i Highlighted specific segements of coding in Red and Green colors.So what I want to do is using thread I want to do these 2 separate for loops.And u cant use one of element in string once it's used by another thread.it's means
Thread1 cant user str[3] while Thread2 is using str[3].Please help me
Thank You