I'm learning Java by reading the online Java book, but im finding it hard to understand "constructors". My question is how would I write a constructor that sets private fields of the class to the values received?
I've attempted this but don't think its correct:
public Biscuit(String id, String Biscuitname, int numOfBiscuits);
So if i have example "12002 digestive 83", i need a constructor that sets private fields of the class to these values received
hope this makes sense