Search:

Type: Posts; User: newbie

Search: Search took 0.09 seconds.

  1. Replies
    7
    Views
    1,819

    Re: How to return class instance?

    Your class is Products not Product
  2. Replies
    7
    Views
    1,819

    Re: How to return class instance?

    Well the answer is in the error message, " missing return statement".
    Take the String example, if you declare a method such as it returns a String, you really do need to return a String.

    If...
  3. Replies
    7
    Views
    1,819

    Re: How to return class instance?

    I'm assuming you want to return your Products object, so all you need to do is change the method declaration from void, to a return type of Products.
    then in your method, use return p;

    E.g
    To...
Results 1 to 3 of 3