Thread: Threads
View Single Post
  #1 (permalink)  
Old 11-20-2007, 03:19 PM
one198 one198 is offline
Member
 
Join Date: Aug 2007
Posts: 15
one198 is on a distinguished road
Threads
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

Code:
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

Last edited by one198 : 11-20-2007 at 03:21 PM.
Reply With Quote
Sponsored Links