aspose file tools*
The moose likes Beginning Java and the fly likes save object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "save object?" Watch "save object?" New topic
Author

save object?

Berty Ahern
Greenhorn

Joined: Mar 03, 2005
Posts: 17
Hi again, this is my last Q for today.
I wish to make an object for saving, called saving i supose but my code doesn't work for some reason. It says that it can't resolve the class saving. I can't figure it out, any ideas?Thanks
code:



Error Text:
--------------------Configuration: <Default>--------------------
C:\JAVA\TabDemo.java:129: cannot resolve symbol
symbol : class saving
location: class TabDemo
saving bookCurrent = new saving(titleTxt.getText(),descTxt.getText());
^
C:\JAVA\TabDemo.java:129: cannot resolve symbol
symbol : class saving
location: class TabDemo
saving bookCurrent = new saving(titleTxt.getText(),descTxt.getText());
^
2 errors

Process completed.


[ March 03, 2005: Message edited by: Berty Ahern ]
[ March 03, 2005: Message edited by: Berty Ahern ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Please post the exact error message you get. Copy and paste is your friend. Also, this will reduce the chance of miscommunication. Many of the important details are lost when you just summarize the error you get.

Also, it would help if you use theUBB code tags when posting your code. This will preserve formatting which makes your code much easier to read. Feel free to go back and edit your original post to do this.

Layne
[ March 03, 2005: Message edited by: Layne Lund ]

Java API Documentation
The Java Tutorial
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Berty,

In order for this code to work, you must have already written a class called saving and it must exist in the same subdirectory or package where TabDemo resides. Incidentally, java standard naming conventions indicate that the name of the class should be "Saving", not "saving", as class names are to be capitalized. If you do have a class named "Saving", then your problem is simply spelling the class name wrong, as capitalization does matter in java.

If the "saving" class is in another package such as com.mycompany.util, you must declare an import for the class as in "import com.mycompany.util.saving;"

Merrill


Merrill
Consultant, Sima Solutions
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Also you should change your main method so it does what your comment suggests
Berty Ahern
Greenhorn

Joined: Mar 03, 2005
Posts: 17
Ahh I see,
I was copying the code from an example which had the Saving class set up in a seperate file. I shoulda known
Thanks for the help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: save object?