Search:

Type: Posts; User: nera1981

Search: Search took 0.09 seconds.

  1. Replies
    7
    Views
    1,844

    Re: How to return class instance?

    It was, but I changed it to Product, because it should contain data for one product.
  2. Replies
    7
    Views
    1,844

    Re: How to return class instance?

    Here is the code snippet (to which error message is referring to):
    class Product

    public static Product getFromId(int productID)
    {//this is the line 158//
    main class(Sales)
    ...
  3. Replies
    7
    Views
    1,844

    Re: How to return class instance?

    I tried that, but it's not working.
    I get error message saying:
    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - missing return statement
    at...
  4. Replies
    7
    Views
    1,844

    How to return class instance?

    I have the next code:


    import java.sql.*;

    public class Products {
    private int ProductID;
    private String name;
    private String category;
    private Double price;
Results 1 to 4 of 5