Invalid pakage declaration and can't impot error

I am writing a shopping cart class that can store the shopping cart informations. But for some reason my
Cart class can not import from ShoppingCart class,
does anyone has anyidear
Please help me out
thanks in advance.
import java.util.*;
public class ShoppingCart {
* default constructor
public ShoppingCart(){
this.itemid=0;
this.attributeid = new Hashtable();
this.orderid =0;
this.price =0;
this.quantity =0;
public void setItemID(int itemid){
this.itemid = itemid;
public void setAttributeids( String key, String value){
if(null==(String)attributeid.get(key)){
attributeid.put(key,value);
else{
attributeid.remove(key);
attributeid.put(key,value);
public void setPrice(double price){
this.price = price;
public void setQuantity(int quantity){
this.quantity = quantity;
public void setOrderID(int orderid){
this.orderid = orderid;
public int getItemID(){
return itemid;
public Hashtable getAttributeids(){
return this.attributeid;
public double getPrice(){
return this.price;
public int getQuantity(){
return this.quantity;
public int getOrderID(){
return this.orderid;
private int itemid;
private Hashtable attributeid;
private int orderid;
private double price;
private int quantity;
}// end class shoppingCart
import java.util.*;
import ShoppingCart;
public class Cart{
* default constructor
public Cart(){
cartHash = new Hashtable();
public void setShoppingCart(ShoppingCart cart, String key){
if(null==(ShoppingCart)cartHash.get(key)){
cartHash.put(key,cart);
public ShoppingCart getShoppingCart(String key){
return cartHash.get(key);
public int getTotal(){
total = 0;
Enumeration keys = attributeid.keys()
while(keys.hasMoreElements()){
ShoppingCart item = (ShoppingCart)cartHash.get((String)keys.nextElement());
int subtotal = item.getQuantity()*item.getPrice();
total + = subtotal;
return total;
public int getItem(){
return cartHash.size();
private Hashtable cartHash;

WEB-INF/classes/Cart.java [11:1] Class ShoppingCart not found in type declaration or import.
public void setShoppingCart(ShoppingCart cart, String key){
^
WEB-INF/classes/Cart.java [17:1] Class ShoppingCart not found in type declaration or import.
public ShoppingCart getShoppingCart(String key){
^
2 errors
Thanks for you replay.
when i remove import ShoppingCart; it give me above errors. Please helps

Similar Messages

  • Can not update error 1602 and can not restore error 1604 what is the solution

    Have a IPod touch 4, can't update (error 1602) and can't restore (error 1604) any solution?

    try this support article.

  • Can't burn playlist and can't interpret error code

    Suddenly, I can't burn MP3s on to a disk. My diagnostics check says "The last MP3 CD Burn has error code -128(0xfffff80). I can't find a place to interpret what this code is.

    Well, trying CD-Rs will not really solve the error because as I discovered, the RWs that Boot Camp told me failed to burn actually burned just fine! I discovered before trying to reerase them and try burning them with a different application that the contents were all proper and in tact. It is Boot Camp's error. I am going to mark this as solved and leave feedback for the Boot Camp team about the error. Thanks for your input.

  • IPhone 4s is in recovery mode and can't restore, error 9.

    My iPhone 4s crashed and is now in recovery mode. I've tried to restore it through iTunes but error 9 keeps occuring. I've done everything it says to stop from error 9 from occuring but still can't restore my phone and is stuck in recovery mode. HELP.

    Haylie21 wrote:
    everything with my third-party security software is conflict free and good, but is still not able to restore.
    The issue could be with whatever the Unnecessary on a Mac 3rd Party AV software is...
    Turn it OFF.
    Better yet... Uninstall it.
    FYI:
    In General 3rd Party AV Software is Not Required as Mac OS X tends to look after itself.
    Read Here  > https://discussions.apple.com/thread/4545776?tstart=0
    See Here  >  Antivirus Discussion
    The Safe Mac  >  http://www.thesafemac.com/mmg/
    Also have a look at this Informative Discussion (June 2013 )
    https://discussions.apple.com/message/22247724

  • I have a problem with HP ToolboxFX and the encountered an error and can not recover error msg.

    Restarting the software and/or the computer do not fix the error.  I have installed the new firmware in my CP2025dn Color Laser it now has version 20110212 firmware.  The error msg reports: windows version Win32NT-6.0.6002.131072 and HP Toolbox FX version 004.012.00146.  I am running the printer on my wireless router.  My computer is a Dell Studio with Vista Home Premium Service Pack 2 - 64 bit OS.  My wife's older laptop with WIN XP is not having a problem with Toolbox.  I have uninstalled and reinstalled Toolbox on my computer today also.  Where do I look next?  Thank you!!!

    Hi
    Please find the link given below might help you to fix your issue.
    Link
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • Invalid package declaration:

    If you read my post a few messages down, I asked how to add a package in NetBeans. Solved (THANKS).
    But now I get this error when I mouseover the items in the package. Can I get an exact walkthrough on what to do to enable a package to work in NetBeans?
    l'll be more specific. I downloaded the jpb package from http://knking.com/books/java/ (Near the bottom)
    NetBeans saves my projects in C:\Documents and Settings\Administrator. So (In accordance with the instructions given in the book) I made the dir. C:\Documents and Settings\Administartor\jpb and inserted 3 .java files in it (SimpleIO.java Convert.java and DrawableFrame.java). From this point, what do I do so that (in netbeans) I can type import jpb.* and not get any errors?
    THANKS AGAIN FOR EVERYONE WHO HELPS

    You must compile these files, and I suggest you to
    create a jar library:
    New project -> General -> Java Class Library
    Copy your sources in it and build project. This will
    generate a .jar in the dist folder in mounted
    filesystem.
    Now add this builded jar in your project library as
    commented before.
    mariOHey there, I'm also a newb facing a similar error...
    I backed up a package by copy - pasting it and now i mounted it. However, when i mouseover any of its classes it says "Invalid package declaration" and i can't solve it....
    pls help
    THX!!!

  • I cannot install adobe reader. I get so far and get the message "Error 1324. The oath All folders or the volume is invalid. Please enter it again" can you help?

    i cannot install adobe reader. I get so far and get the message "Error 1324. All folders or the volume is invalid. Please enter it again" can you help?

    We need to know if any registry settings are causing this error.  Please follow these instructions:
    from Windows Start | Search: type regedit and hit Enter; you will see a window like this
    now click on the little arrow ▹ left from HKEY_CURRENT_USER
    Next click the arrow ▹ beside Software, then Microsoft, then Windows, then CurrentVersion, then Explorer, then click on User Shell Folders
    all entries on the right side should start with %USERPROFILE%
    If you have anything different, this may be the cause for the install failure.
    Now you need to repeat the same thing for another key:
    ▹ HKEY_LOCAL_MACHINE ▹ Software ▹ Microsoft ▹ Windows ▹ CurrentVersion ▹ Explorer ▹ User Shell Folders
    Here all entries should start with %PUBLIC% or %ProgramData%.  If you have anything different, this may also be the cause for the install failure.

  • I try to update iTunes but get error saying invalid signatures? why can't I update?

    I try to install new version iTunes, safari and quick time and can't. I get error saying " invalid signatures". Why will these not install? I have windows xp.

    Why? Don't know.
    How to fix this...
    Download iTunes again and then run the install. When his happened to me, the second download and install ran without any problem.

  • Im trying to upgrade iTunes to v 10.6 on a windows vista pc and keep getting the error, "Invalid Drive /E".  What do I do to get past this?

    I'm trying to upgrade to iTunes v 10.6 on a windows vista pc and keep getting the error, "Invalid Drive/E".  What do I do to get past this?

    Open a Windows Command prompt, e.g. Hit Start > Run, type in CMD and press OK.
    Type in SUBST E: C:\<enter>
    This will map E: to C: until the machine is restarted or you enter SUBST E: /D at the command prompt. Now you can try uninstalling or upgrading the software again.
    (If upgrading software which lets you choose a location, install the software in the default location, not on the E:\ drive.)
    See here for more info.
    tt2

  • Serial code invalid for downloading 9.0 on one computer, and can't find serial number of acrobat xi on other computer?

    serial code invalid for downloading 9.0 on one computer, and can't find serial number of acrobat xi on other computer?

    Lost information
    https://www.adobe.com/account.html for serial numbers or subscriptions on your Adobe page... or
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html
    -http://helpx.adobe.com/creative-suite/kb/error-serial-number-valid-product.html

  • IOS app Validate : Error bundle is invalid.New apps and app updates submitted to the app store must be built with public?

    I am using Xcode 5.1 with SDK 7.1
    I tried to validate  new version in appstore.But its failed.Error message:"Bundle is invalid.New apps and app updates submitted to the app store must be built with public?"
    On Apirl 18  ,I can submit last version

    It would help if you posted your problem in the form of a question.
    What version of Xcode are you using?

  • How can I overcome error message "missing or invalid personalisation info" when trying to re-install Elements 3. I need to re-install Elements 3,

    How can I overcome error message "missing or invalid personalisation info" when trying to re-install Elements 3. I need to re-install Elements 3,
    @ Alternatively purchase an Elements 9 or 10.  Holding Elements13 but that needs OS 10.8 (Lion) and much of my data is in Appleworks, which is incompatble
    Apologies if I am using this incorrectly.  My first time here

    Hi.  Thanks for coming back to me.  I am using Mountain Leopard (OSX 10.6.8).  Had major problem and have re-formatted my H/D and re-installing software.  Must have lost a file in the process.  Would upgrade to Lion only I have a lot of vital data in Officeworks, but that is incompatible with Lion.

  • I uninstalled Firefox once, reinstalled it and it ran. I had a problem so I did it again. Now it will not run and I get an error message saying that firefox is running and you can only run one at a time. I can't figure out what is running.

    Because of a problem, I uninstalled Firefox once, reinstalled it and it ran. I had a problem so I uninstalled/reinstalled it again. Now it will not run. I get an error message saying that firefox is running and you can only run one at a time. I have uninstalled multiple times and can't figure out what is running. The is only one Firefox installed and it is not open. What does this mean and how do I fix it?

    If you use ZoneAlarm Extreme Security then try to disable Virtualization.
    *http://kb.mozillazine.org/Browser_will_not_start_up#XULRunner_error_after_an_update
    See also:
    *[[/questions/880050]]

  • I just purchased survivor season 11 to watch on my iphone4. I synced the first 4 episodes and I get an error message that episode 2 can not be played in my iphone4? How do I get it to play on my iPhone 4?

    I just purchased survivor season 11 to watch on my iphone4. I synced the first 4 episodes and I get an error message that episode 2 can not be played in my iphone4? How do I get it to play on my iPhone 4?

    In order to use ''nxm://'' links, Nexus Mod Manager must be installed and associated with the ''nxm'' protocol.
    * http://www.nexusmods.com/skyrim/mods/modmanager/
    In case of problems with this third-party program, please refer to its support forum:
    * http://forums.nexusmods.com/index.php?/forum/1413-nmm-code-development-chat

  • I am trying to download latest version of Safari and Itunes, and I get an error message that my signature is invalid.

    I am trying to download latest version of Itunes and Safari, and I get an error message that my signature is invalid.  Help?

    I am trying to download latest version of Itunes and Safari, and I get an error message that my signature is invalid.  Help?

Maybe you are looking for

  • Anyone else having problem with running app on iOS 5.0.1 iPod

    Ever since I installed the latest iOS on my iPod (third generation) I have issues. App, especially games are crashing  A LOT. I think either they are making it all compatible with iPhone 4 or iPad or something is really wrong. I cannot afford to pay

  • Why Garageband doesn't let me send email more than 10 mb suddenly since today 1/10/14

    Why Garageband doesn't let me send email more than 10 mb suddenly since today 1/10/14. Just destroy my business of voice over. It makes me furious first thing in the morning!!Why????

  • Cs5 / dynamic link / MP

    working with cs5 production bundle, dual xeon 5650, quadro fx 3800, 12gb ram. every time i import a premiere sequence (avcintra100) into ae, the multi-processor rendering is disabeld because of "incompatible effects or expressions" . no effects in th

  • BOM quantity and Base quantity

    Hi, I have the follwoing scenario in BOM. I have a plate size of 700 (OD) x 500(ID) x 60 (Thickness). I'll cut this plate in to following different items (Different material code) and qty A - 28 B - 3 C - 1 D - 1 E-  2 How can I define in BOM in term

  • WSDL in JBI

    HI, I read the spec well lot of stress was put on WSDL based service description.But when i look at various sample components provided with JBI RI.I hardly see services describing them with WSDL. Is it something against the specs. most of the time i