do while loop with nested two while
<p>I get the problem, when I compile my program not error, but when I running the program doesn't perform anything. JDK have been installed. Other program running well. what is my problem?? because nested loop ??</p>

<pre><code>import java.io.*;
import java.io.PrintStream.*;
public class Latihan3 {
  public static void main (String args []){
  int data1=0;
  int data2=0;

  char temp1;
  char temp2;
  boolean done=false;
  String simpan1;
  String simpan2;
  String konversi;
  String jenis="";
  String kata1="";
  String kata2="";
  FileInputStream fis1 =null;
  FileInputStream fis2 =null;
  FileOutputStream fos =null;
  FileOutputStream fos2 =null;
  DataOutputStream dos =null;
  DataOutputStream dos2 =null;
  PrintStream ps = null;
  PrintStream ps2 = null;

  try {
  fis1 = new FileInputStream ("D://hasil2.txt");
  fis2 = new FileInputStream ("D://latihan.txt");
  fos = new FileOutputStream ("D://latihan2.txt");
  fos2 = new FileOutputStream ("D://katabaru.txt");
  dos = new DataOutputStream (fos);
  dos2 = new DataOutputStream (fos2);
  ps = new PrintStream (dos);
  ps2 = new PrintStream (dos2);
  } catch (IOException e){
   System.out.println ("Eksepsi :"+e.getMessage());
  }
  try{


  do { 


     data1=fis1.read();
     temp1=(char)data1;
     data2=fis2.read();
     temp2=(char)data2; 



     while (temp1 != ' ' ){
      simpan1 = String.valueOf(temp1);
      kata1 = kata1.concat (simpan1); 
      data1=fis1.read();
      temp1=(char)data1; 
     }

     data1=fis1.read();
     temp1=(char)data1; 
     jenis = String.valueOf(temp1);
     data1=fis1.read();
     temp1=(char)data1;


     while (temp2 != ' ' ){
      simpan2 = String.valueOf(temp2);
      kata2 = kata2.concat (simpan2);
      data2=fis2.read();
      temp2=(char)data2;

     }

     if (kata1.equals (kata2)){
      ps.print (kata1);
      ps.print (' ');
      ps.print (jenis);
      ps.print ('/');
      kata1="";
      kata2="";
     }else {
      ps.print (kata2);
      ps2.print (kata2);
      ps2.print (' ');
      ps2.print (jenis);
      ps2.print ('/');
      ps.print (' ');
      ps.print ('?');
      ps.print ('/');
      kata1="";
      kata2="";
     }


  } while (data2 != -1);

 System.out.println ("data telah dimasukan");
 } catch (IOException e){
  System.out.println ("Eksepsi :"+e.getMessage());
 }
}
}
</code></pre>
