Mystic
BAN USERGood logical ability ,passionate about coding and algorithms.
- 0of 0 votes
AnswersWrite a writer thread and a Reader that share a fixed-size buffer and an index to access the buffer .The writer should place numbers into the buffer while the Reader thread should remove the numbers.The order in which the numbers are added or removed is not important.
- Mystic in India| Report Duplicate | Flag | PURGE
United HealthGroup Java Developer
public class CheckSum {
/**
* @param args
*/
public static void main(String[] args) {
int a[]={4,5,1,3,2};int c[]=new int[2];int j=0;
for(int i=0;i<a.length;i++)
{j=1;
while(j<5)
{System.out.println("j"+j);
if(a[i]+a[j]==6)
{System.out.println("good"+"\n");
for(int t=0;t<2;t++)
{
//int b[]=new int[t];
c[0]=a[i];
//t--;
c[1]=a[j];
System.out.println(c[t]);
}
}
j++;
}
}
}
}
Can you send other code where you mentioned Node and function for send and receive message.
- Mystic June 14, 2013