• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

save object?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also you should change your main method so it does what your comment suggests
 
Berty Ahern
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic