Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures - Retired Organizing Data Serialization

Can not find symbol - ObjectOutputStream, IOException

I have written the code exactly as the video has suggested me to but even after using import java.io.*; I am facing the problem cannot find the symbol ObjectOutputStream and IOException. Here is the snapshot - https://w.trhou.se/ic60dxwzzu

ERROR
./com/teamtreehouse/Treets.java:8: error: cannot find symbol                                                                        
     ObjectOutputStream oos = new ObjectOuputStream(fos);                                                                           
                                  ^                                                                                                 
  symbol:   class ObjectOuputStream                                                                                                 
  location: class Treets                                                                                                            
./com/teamtreehouse/Treets.java:12: error: cannot find symbol                                                                       
    catch (IOExceptions ioe) { 
Treets.java
package com.teamtreehouse;

import java.io.*;

public class Treets {
  public static void save(Treet[] treets) {
   try(
     FileOutputStream fos = new FileOutputStream("treets.ser");
     ObjectOutputStream oos = new ObjectOuputStream(fos);
   ) {
     oos.writeObject(treets);
   }
    catch (IOExceptions ioe) {
      System.out.println("Problem saving treets.");
      ioe.printStackTrace();
    }
  }
 }

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

Looks like the error is due to a typo. You left off the first t in Output for new ObjectOutputStream(fos).

I am really sorry I did such a grave mistake. Thank you for pointing out the mistake.