Results 1 to 6 of 6
  1. #1
    teardrop3903 is offline Member
    Join Date
    Apr 2011
    Posts
    8
    Rep Power
    0

    Default assistance needed

    My problem is i don't know how i can tie in my driver class to my other packages.

    my packages and class files are set up like this

    Lab_1 < Project
    model < Package
    - Automobile
    - OptionSet
    - Option
    autoUtilities < Package
    - FileIO
    default < Package
    - Driver
    -> FordZWT.txt < my text file

    class Driver looks like this
    Java Code:
    import model.*;
    import autoUtilities.*;
    
    public class Driver {
    	
    	public static void main(String[] args) {
    		Automobile FordZTW = Lab_1.autoUtilities.FileIO.readFile("FordZWT.txt");
    		FordZTW.print();
    		Lab_1.autoUtilities.FileIO.serializeAuto(FordZTW);
    		Automobile newFordZTW = Lab_1.autoUtilities.FileIO.deserializeAuto("auto.ser");
    		newFordZTW.print();
    	}
    }

    for some reason its not working.
    any ideas?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by teardrop3903 View Post
    for some reason its not working.
    any ideas?
    "its not working" doesn't tell us much. Any details to provide such as error messages and the like?

  3. #3
    teardrop3903 is offline Member
    Join Date
    Apr 2011
    Posts
    8
    Rep Power
    0

    Default

    The errors happening at all places with Lab_1.

    Lab_1.autoUtilities.FileIO.readFile("FordZWT.txt");

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by teardrop3903 View Post
    The errors happening at all places with Lab_1.

    Lab_1.autoUtilities.FileIO.readFile("FordZWT.txt");
    For us to be able to have a chance at helping you, you'll need to post the error messages and the offending code. And I have to wonder, what does the readFile method return? Does it return an Automobile object? If not, then it would make sense that that line would cause problems.

  5. #5
    teardrop3903 is offline Member
    Join Date
    Apr 2011
    Posts
    8
    Rep Power
    0

    Default

    There is no error message because i can't compile my program with the offending code

    Java Code:
    import model.*;
    import autoUtilities.*;
    
    public class Driver {
    	
    	public static void main(String[] args) {
    		Automobile FordZTW = [U]Lab_[/U]1.autoUtilities.FileIO.readFile("FordZWT.txt");
    		FordZTW.print();
    		[U]Lab_1[/U].autoUtilities.FileIO.serializeAuto(FordZTW);
    		Automobile newFordZTW = [U]Lab_1[/U].autoUtilities.FileIO.deserializeAuto("auto.ser");
    		newFordZTW.print();
    	}
    }
    when i run my cursor over it it just says Lab_1 cannot be resolved.

    yes, the readFile method returns an automboile object.

    If you'd like to see all my class i can post them up as well.
    Last edited by teardrop3903; 04-18-2011 at 04:29 AM.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    why have Lab_1 in there at all as you seem to be able to import autoUtilities OK. What if you just do:

    Java Code:
    Automobile newFordZTW = FileIO.deserializeAuto("auto.ser");

Similar Threads

  1. Assistance needed ASAP: Postpix program
    By Debonairj in forum New To Java
    Replies: 18
    Last Post: 07-27-2010, 02:37 PM
  2. Assistance about this.
    By Syfer in forum Advanced Java
    Replies: 38
    Last Post: 06-21-2010, 06:59 PM
  3. Ascii To URL Assistance Needed
    By Sean_J in forum New To Java
    Replies: 2
    Last Post: 03-10-2010, 05:35 AM
  4. Looking for assistance
    By s_dawg101 in forum New To Java
    Replies: 32
    Last Post: 11-04-2009, 03:49 AM
  5. In need of some assistance
    By Boer84 in forum New To Java
    Replies: 2
    Last Post: 07-08-2008, 05:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •