   Java compile error(solved)
  Okay, I put a bunch of / around the error.  I'm trying to write to a file, but the compiler keeps on giving me an error.  import java.io.*;import java.awt.*;import java.awt.event.*;import java.text.*;public class assignment extends Frame implements ActionListener{DataOutputStream output;InputStream input;Panel panel = new Panel(new GridLayout(3,2));Label lTitle = new Label("Assignment Title: ");Label lDescription = new Label("Description: ");Label lGrade = new Label("Grade: ");TextField title = new TextField(20);TextField description = new TextField(20);TextField grade = new TextField(20);Button button = new Button("Submit");public assignment(){setLayout(new BorderLayout());add(panel, BorderLayout.CENTER);panel.add(lTitle);panel.add(title);panel.add(lDescription);panel.add(description);panel.add(lGrade);panel.add(grade);add(button, BorderLayout.SOUTH);button.addActionListener(this);addWindowListener(new WindowAdapter(){public void windowClosing(WindowEvent e){System.exit(0);}});}public void actionPerformed(ActionEvent e){e.getActionCommand();if(e.getActionCommand() == "Submit"){try{output = new DataOutputStream(new FileOutputStream("Grades.grade"));}catch(IOException f){System.exit(1);}try{output.writeUTF(title.getText());output.writeUTF(description.getText());output.writeUTF(grade.getText());}catch(IOException g){System.exit(1);}button.setLabel("Retrive");try{input = new DataInputStream(new FileInputStream("Grades.grade"));}catch(IOException l){System.exit(1);}}if(e.getActionCommand() == "Retrive"){try{/////////////////////////////////////////////title.setText(input.readUTF());//Cannot find symbol 'readUTF()'}/////////////////////////////////////////////catch(IOException u){System.exit(1);}}}public static void main(String args[]){assignment j = new assignment();j.setSize(400,400);j.setVisible(true);j.setTitle("Assignments");}}[Edited by - Drunken_Monkey on May 15, 2006 10:20:25 AM]
  What error?   ;  title.setText(input.readUTF());//Cannot find symbol 'readUTF()';  A stream could deal with bytes only. readUTF() is of the DataInputStream class (the DataInput interface to be correct). But since the member input is of the InputStream only type, the compiler doesn't find the routine.So, use this member definition:   DataInputStream input;instead of   InputStream input;   ;  From what i can see here, readUTF() in't a method of InputStream.Dave   