Hi,

I am getting an error message as follows:

java.lang.NoClassDefFoundError: inventorypart1/Beverages
Caused by: java.lang.ClassNotFoundException: inventorypart1.Beverages

I have been running programs with no problem and with this message I am confused. I cannot see what I am doing wrong but I think I have been looking at it too long.
Any input would be appreciated.

Thank you,
lynnajoe

package inventorypart1;


import java.util.*;
import java.io.*;
import java.text.NumberFormat;

/**
 *
 * @author Lynn
 */public class Products {
public static String name;
public static double stkNumber;
public static double NumInStk;
public static double price;
public static double stkValue;
/**
 *
 * @param name
 * @param stkNumber
 * @param NumInStk
 * @param price
 * @param stkValue
 */
public Products(String name, double stkNumber, double NumInStk,double price, double stkValue)
    {
    }

    /**
     * @param args the command line arguments
     */
    @SuppressWarnings("unchecked")
    public static void main(String[] args) {


    }


    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the stkNumber
     */
    public double getStkNumber() {
        return stkNumber;
    }

    /**
     * @param stkNumber the stkNumber to set
     */
    public void setStkNumber(double stkNumber) {
        this.stkNumber = stkNumber;
    }

    /**
     * @return the NumInStk
     */
    public double getNumInStk() {
        return NumInStk;
    }

    /**
     * @param NumInStk the NumInStk to set
     */
    public void setNumInStk(double NumInStk) {
        this.NumInStk = NumInStk;
    }

    /**
     * @return the price
     */
    public double getPrice() {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(double price) {
        this.price = price;
    }

 public double calculate(){

         return price*NumInStk;



    }
 }

because your main method mising any statement

public static void main(String[] args) {

}

from where you get this code, try if works in previous forms, maybe yes, maybe no, because there I can't see any usage of Java imports

Thanks- I have been looking at it too long I guess. Thank you again.

lynnajoe

you are welcome

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.