Search:

Type: Posts; User: ymbulk

Search: Search took 0.10 seconds.

  1. Replies
    7
    Views
    1,154

    Re: How to call a constructor in main

    I compile the program fine, just that I would like to call the PrepaidCard constructor instead of calling the setCardID method.
    Do you know if it is possible to do that?
  2. Replies
    7
    Views
    1,154

    Re: How to call a constructor in main

    This is the PrepaidCard class.

    public class PrepaidCard
    {
    private String cardID;
    private int tokenBalance;

    public PrepaidCard(String id, int token)
    {
    cardID = id;
  3. Replies
    7
    Views
    1,154

    Re: How to call a constructor in main

    Thanks for your reply and reminder of cross posting.
    I have omitted the declaration of the variables, but if you want, I can update the code to make it compile.
    Do you know how to call the...
  4. Replies
    7
    Views
    1,154

    How to call a constructor in main

    Hey guys, I am trying to call a constructor from PrepaidCard class in my main method, but I am not sure how to proceed.

    As seen below, both the PrepaidCard constructor and the setCardID method...
Results 1 to 4 of 4