text: Comment on Tutorial - Transient vs Volatile modifiers in Java By Reema sen
  Comment Added by : Prithvi
  Comment Added at : 2010-01-07 10:24:12
  Comment on Tutorial : Transient vs Volatile modifiers in Java By Reema sen.
  package javabeat.samples;
  class ExampleThread extends Thread {
  private volatile int testValue;
  public ExampleThread(String str){
  super(str);
  }
  public void run() {
  for (int i = 0; i < 3; i++) {
  try {
  System.out.println(getName() + " : "+i);
  if (getName().equals("Thread 1 "))
  {
  testValue = 10;
  }
  if (getName().equals("Thread 2 "))
  {
  System.out.println( "Test Value : " + testValue);
  }
  Thread.sleep(1000);
  } catch (InterruptedException exception) {
  exception.printStackTrace();
  }
  }
  }
  }
  public class VolatileExample {
  public static void main(String args[]) {
  new ExampleThread("Thread 1 ").start();
  new ExampleThread("Thread 2 ") code for images hitting in jsp like googl
  View Tutorial By: Kumaravel at 2014-08-06 11:23:08
  2. great work
  View Tutorial By: Dinesh557 at 2008-09-25 00:27:59
  3. So I followed you steps with no compile errors. W
  View Tutorial By: PointLookoutResident at 2014-10-14 19:01:11
  4. Thank You , It's Very Good.
  View Tutorial By: Jack at 2012-06-10 14:09:24
  5. I don't get it... there seem to be only two differ
  View Tutorial By: bibiki at 2012-04-05 02:01:32
  6. is it possible to change the increment variable?
  View Tutorial By: Lundi at 2013-04-08 21:21:13
  7. sir,
  When I run the above code and give 6 o
  View Tutorial By: nishant at 2012-07-01 17:11:20
  8. example is good for understand what is the functio
  View Tutorial By: Ankit Shukla at 2009-09-17 15:25:17
  9. Seriously very nice explanation.... Thank You
  View Tutorial By: Pulkit agrawal at 2012-03-20 10:28:10
  10. can any body help me,i need to send a sms from sim
  View Tutorial By: vinayaka DJ at 2011-11-14 12:44:01